Personally, I don't let any strangers give my dog treats. Only people she sees on a regular basis, and only if I (or my partner) tell Diamond it's ok.
The main reason for this is to prevent her from possible poisoning/illness in the future. You can't trust all strangers, and the dog should learn that you, or those you allow, are the ONLY sources of food. Petting and playing is ok, but not food.