Guys, don't screw with dogs. I realize that some people have used this method or that method with success, but don't think that it is foolproof. A large dog that is not afraid of humans (maybe some feral dogs, specifically trained dogs, some with a natural inclination, etc.) WILL NOT simply bite a baseball cap and hold on...you WILL NOT be able to beat such a dog into submission with your bare hands...you WILL get hurt badly.
Hopefully any dog that you meet will be one that is just being aggressive and trying to defend his territory with bluster and threat and is not actually looking to do anything but drive you away. A show of fear is what he is trying to get and he will play up on it and chase you, possibly biting at you, etc. but he is not really trying to hurt you. It's just like human males defending their turf...few of us, unless we are in special circumstances, would actually try to kill each other. Same with the dog.
I'll share some doggy anecdotes...
There are many instances in Vietnam of American dogs being hit by fire from AK-47s and still taking down whomever they were after and walking away without much in the way of recuperation or visible impairment.
A dog's jaws are immensely powerful and a large dog can do damage to a trainer even through a bite suit. The suit is not total protection and you have to be careful even when wearing one and even if the dog is biting at you through the suit itself. I have seen a rather smallish Blue Heeler bite through the thigh of a bite suit and require stitches on the wearer of the suit.
I have personally had the experience of using pepper spray on a "pack" of German shepherds guarding a man's yard and finding that they didn't back down but only got madder. Fortunately for me, they were on the other side of a high chain link fence and we were just trying to get them away from the gate so that we could get in. It took most of two cans of spray RIGHT in the face, nose, mouth, eyes, etc. of the dogs from point blank through the fence to take the fight out of them. It most definitely did not get an immediate response from them other than anger.
I know a lot of guys who think that they can hold up their off arm to "take" the brunt of a dog's attack and then use their other arm to beat the dog into submission, whether bare-handed or with a club. In some cases it might just work...but I really wouldn't recommend it.
Sorry to ramble on...my answer to a question like that posed would be that I would probably not hesitate to shoot an aggressive dog. If it were on a chain or contained, I would not because of legalities of discharging my weapon and such but, if I and one or both of my little girls were out walking and a dog of size was plainly about to attack rather than just try and intimidate, there is no question about what I would do.