I usually carry a knife on our neighborhood walks with my daughter. We don't take our dog for walks because she doesn't behave. She leash aggressive towards others. Thats what a responsible owner does. If you know your dog has issues, don't bring them out around others.
If a dog came out or became aggressive to my kids it's getting put down real fast.
But I would go to a knife before my gun. Shooting at a wild attacking dog is not easy to do. i would give up an arm to bite get it on the ground and cut its throat. You'll end up with some bites, but it's better than shooting wildly and hitting something I don't want to (my kids)
An aggressively approaching dog doesn't get a 2nd chance around my kids.
I will defend myself and my dog with a level of force that is proportionate to the amount of damage that the attacking dog can inflict. So a yippy little ankle biter will get a gentle kick at most, to keep it away. But if its a pitbull/Rottweiler/Doberman/German Shepherd...I am not going to give it the opportunity to maul me. I do manual labor for a living and I cant work if the muscles and tendons in my arm have been torn to shreds. Sorry, thats one of the main reasons I carry a .38 snubby when I walk my dog.