I live out in the countryside. If I run into someone in the road, I will nod my head, maybe introduce myself, and maybe chat, if the other person is interested. (To be fair, I know about 80% of the people I see in the road.) This is normal behavior. Sometimes, two cars will pass each other and stop to talk.
I have also lived in the city. If a stranger wants to talk to me in the city, either they're looking for directions (happy to help!), or they are deeply confused about appropriate social behavior in crowded spaces. In the latter case, I'm lucky if the stranger-with-no-boundaries merely wants to warn me about the dangers of the lizard people. So I've learned to ignore strangers.