Well done OP, and I know it can be tricky with friends.
Friends of ours have two children much younger than our teen girls, and they are pretty much never said "no" to. The 3 year old was running around chasing our sheltie. I kept saying "don't chase the dog, he'll get cross with you!" Now, this is the most gentle, easy going dog you can imagine, but he's 9 and it's not fair on him to be chased.
Of course, parents did nothing to back me up. Then the boy suddenly grabs dog and pulls out a massive handful of fur. Dog immediately nipped him. He didn't break the skin, but the little boy did have a very red mark across his hand, and he started screaming the place down. Parents immediately cuddled him saying "poor you, naughty doggy" etc.
Well, I saw red, I tell you, and all politeness went out of the window! I was so cross! I said to the little boy, " that's what happens if you pull a dog's fur. It will bite you. I told you to leave him alone.
" To my friends I said, "You are jolly lucky it was our sheltie and not our young terrier, because she would have had his hand off (maybe a bit of an exaggeration, but you get my point
) and it wouldn't have been the dogs fault."
They went home in a bit of a sulk. But they got over it, and he's never tried to annoy the dogs again! You just have to be firm and say your piece sometimes. You're doing people a favour, because who knows how a strange dog in the street might react.