Just so you know, I'm one of those who always calls to dogs and tries to pet them when I'm out. When I had a dog and was out walking him I would have no problem with anyone coming up and petting him, though I don't remember anyone doing so.
As for cats, obviously feral cats are out. You just don't go near them. But if a cat is reasonably plump and has a collar, and seems approachable I will always try to pet them. I've made friends with quite a few cats here that way, and now when they see me they come running for their pets. There is one who always runs away though: maybe it's my cologne?
Seriously though, I would not advise anyone to pet or approach a cat that looks feral, or does not allow the approach. They're flighty creatures and could easily scratch you or worse if you piss them off.