I'm not really a dog person, as far as keeping a dog. I like dogs well enough, but I'm scared of big dogs. Even so, I would never make the assumption that petting a stranger's dog is OK without their permission. If I've been turned down, I've usually been turned down politely, and I don't make a fuss. Not every dog likes new people, not every dog likes being touched or petted, especially by strangers, and that's OK with me.
I really, really don't understand people who will shove their kids over to "pet the nice doggie" without the "nice doggie's" owner's permission. That's just rude and presumptuous, and ASKING for your kid to get bitten if the dog isn't used to kids or just doesn't really feel comfortable around strangers or what have you.
I was nipped by a small but very protective beagle when I was a year old. I was visiting my great-uncle and his family (my mom's cousins) in Panama, and the dog did not like it when people approached my great-uncle - Neno was very protective of Uncle. I, of course, didn't know or understand this, so I ran up to my great-uncle to carry me when the dog was at his feet, but when my mom tried to pull me away - too late, damage done. The dog nipped me, I cried and made a fuss and was afraid of dogs for a long time after that. I was even afraid of Boogie, my aunt's mutt (also part beagle) when we got back home to the States. Boogie adored me and I adored him, but my experience with Neno stuck with me for a while. Of course, I don't remember this myself, but my mom told me the story when I was older.
Once I got over my fear of dogs, I've always been very careful to ask an owner permission to pet or approach a dog in any way if I like the dog and feel inclined to pet it. But it took me a long time to even get to that point; it took until I was about 15 or 16 to feel really comfortable around dogs and not give them a wide berth.
Another pet peeve of mine is people who want to pet guide dogs or companion animals for the disabled.
When I was in college, we had a blind student who actually had a little sign, tooled out of leather, that read, "Please don't pet me. I'm on duty right now," on his guide dog's lead. I thought it was pretty sad that it was necessary for him to do that. We actually had a couple of classes together and I got friendly with him, to the point where, when Doggie (I forget his name) was off-duty, ie, resting before class, I was allowed to pet the dog. I took to carrying a bowl in my backpack to offer the dog a drink of water before class if it was a particularly hot day (which it sometimes could be, given that the town I went to college in has a semi-arid climate). The blind student said I was the first person he'd given permission to approach the dog because I respected the dog when he was working, to which I responded, "Well, I can read, and I know better than to approach a guide dog when he's working." He also noted that I was the first person who had ever been kind enough to offer his dog water on hot days. I thought that was pretty sad, too.