'Can I pet your dog?'
My answer to this question has changed over the years. The first eight or so years with my last dog was easy. 'Sure' or 'yes' was the answer. He was a herding dog mix, very calm and quietly friendly. Strangers could pet him on the head, even four people could pet him at the same time.
The last year and a half of his life the answer had to change. The decline of his vision and hearing made him a bit jumpy and more likely to bark once or twice at people who startled him or who had so-so dog skills. He did not like folks to pet him on the head or further back. He liked slow movements, and to be petted under the head. I note that many books suggest that dogs should not be petted on the head.
So during the last part of his life I said to those who asked, "He is friendly, but may bark once if he does not like the way you pet him'. And that worked out fairly well, He barked at about half the folks who tried to pet him. I explained to those people about his age and how he preferred to be petted. Many folks seemed to think they were doing him a favor by giving him ten seconds on their time. I pet dogs by stroking them below the head and on their back if they permit it for 30-60 seconds.
My current dog took a bit of trial and error. He is a high energy mix, he dances, twists, jumps, darts, etc. I did not raise him, but got him at around three or four years of age. He chews everything, and eats any food. Apples, cherry tomatoes, bananas, chips, etc. His dog relating skills are not the best. He will often go into his 'I want to play' routine, barks once, posture lowered, which many other dogs will see as a hostile gesture.
When someone asked if they can pet my current dog, I have a longer answer. I tell the person that the dog has no interest in being petted by strangers, but will accept a treat. At that time I offer a treat to the person. Pretty much any treat will do, liver training treat, dry dog biscuit, bacon flavored. Most of the time the person will take the treat and offer it to the dog. That has worked out well for the most part.
Sometime a second person will enter the picture. For example, yesterday as one person was offering the dog a treat from me, a second person passing by reached out to the dog. The dog barked once or twice at the second person, who expressed surprise.
I would be interested how others respond to the 'Can I pet your dog' question.