Here is an interesting question. And here is my response from the comments section:
In my neck of the woods it would be illegal.
Use of deadly force (Shooting a gun) can only be used to protect the lives of people (dogs are viewed as property). You have to remember that you will be held responsible for discharging your gun as well as for each and every bullet that you fire. So, I would only do it if I were out in the middle of nowhere. I would not discharge my firearm for the sake of my dog if I was in a public park, walking around my neighborhood, or anything else like that.
That being said, I would probably pull my gun immediately and pistol whip the other dog into submission.