Muzzles can be used to prevent dog bites in situations where you are unsure of how your dog will react. Dogs should be trained in advance to be comfortable wearing muzzles, and this video explains how to do that. Muzzle training is actually a good idea for all dogs and puppies, because dogs who are injured can be unpredictable and may need to be muzzled.
Never put your dog in a situation where you think it's likely he or she will bite, of course. But when you have prepared your dog for a greeting and you believe everything will probably go well, or when your dog needs emergency medical care, a muzzle can come in very handy.