I am an Animal Control officer, investigator, in California. I have investigated hundreds of dog attacks in my more than a decade of service. In my jurisdiction, once your dog is off of your property, it must be leashed. This is a county where CCW permits are just beginning to be issued. In my opinion if you are following the law and are attacked, if you feel that the use of a firearm is justified while you or your dog is being attacked by a loose dog, I would not request charges. I have seen horrific injuries caused to both people and pets in this very scenario. Within the last 6 months we had a man life flighted after a horrific dog attack.
I have fought off many aggressive dogs, singly and in pairs, mostly with an ASP. It is a scary proposition with multiple dogs and more than once it could have been life threatening if not for my cool head, skill with a baton, and knowledge of dog behavior. I can tell you from experience, puffing your chest, yelling, and acting the alpha, at times does nothing. Some dogs are not phased by this and will attack you regardless.
I usually give a whistle when entering a property. This usually will get some response by an animal and will buy me some time if attacked as the distance is increased, as opposed to getting near the front door and getting ambushed or trapped. I carry a long 15 inch metal police clip board. I use the clipboard as a shield and the ASP to strike. Often the clipboard is used to block the dog's view of an oncoming ASP blow. Dogs can kill.
I usually have no back up. If I am attacked, so I do what is necessary to get the job done with me in one piece., I step into the attack and towards the animal and engage. This is not an activity an attacking dog is used to seeing. Most people move away from an attacking dog, I move in. This may momentarily confuse the dog and make the dog reassess their actions and estimations of you. I would never do this if I could not really back it up with defensive action. With two dogs it is usually the alpha who portrays as LESS aggressive at first. The second inferior dog acts HIGHLY aggressive to draw your attention, while the alpha pivots outside of your peripheral vision at your 4 or 8'oclock. The alpha attacks from your flank. Once on the ground you are in trouble. I have had many "crap your pants, jump in and swim moments". Most dogs present body language that is easy to read. Some, like Chow Chows do not.