It's also somehow considered an acceptable method of welcoming attention for the dogs. As though the only thing standing between the dog and a stranger petting it is whether or not the dog is known to bite.
So owners will "welcome" interactions by effectively saying that "Don't worry, he won't retaliate if you take liberties".
I know that that's interpreting it a bit to the extreme edge, but that's the image I get stuck in my head. People are just saying it's okay for you to interact with the dogs, but they're wording it in a very peculiar way.
Foreign humans? Totally on the "out" group, unless the breed is specifically been selected for friendliness (like say, with lab or something.)
This is one of those situations where nurture plays a very big role over nature. If the dog is socialized from a young age and learns that strange humans are hunky-dory, then that's how they're going to react. My ex had chihuahuas (which despite being companion dogs, are not particularly known for their stranger-friendliness) who absolutely
adored anyone and everyone they met while out on walks. I've met labs and goldens who were extremely suspicious and defensive around strangers, and stereotypical guard dogs like rotties and dobes who just melted when some new person showed an interest.
It's also something you can see happen over the course of an adult dog's life, where a shy (but very appreciate of their owner) dog eventually blossoms into a little social butterfly that tries to say hi to everyone they walk past, which again would reinforce the nurture over nature point.