Don't approach a strange dog, especially one which is tied up or confined. Before you attempt to pet a dog, ask permission from the owner. Let the dog become familiar with you by first allowing him to see and sniff the back of your closed hand.
Never leave children unsupervised with any dog, no matter how trustworthy. If a dog is not to be trusted with children or visitors to the home, then consider muzzling it. Modern muzzles allow free air passage and drinking, and do not frustrate the dog.