It’s ok to walk away from anything that doesn’t honor God. Some people we encounter may be under a heavy influence of evil. You may not be able to help fight what they are dealing with. Walking the other way is not the easiest thing to do when we want to fight to help them. The demon they are dealing with may be more than we can handle ourself though. Walk away to regroup and pray for God to fight the demon they are dealing with so we then can help the person. Holy power is the only thing strong enough to fight pure evil.
Don’t do as the wicked do, and don’t follow the path of evildoers. Don’t even think about it; don’t go that way. Turn away and keep moving. For evil people can’t sleep until they’ve done their evil deed for the day. They can’t rest until they’ve caused someone to stumble. Proverbs 4:14-16