I would hope that anyone that is a hunter or shooting a gun for any reason would check there local and state laws before discharging any firearm.
We all hope that, but from many of the posts here and on other gun forums asking questions after the fact, it's pretty obvious that many folks wander into the woods without really knowing what is legal or not, especially when it comes to most anything besides what they may be hunting at the time.
Same goes for folks taking legal advice from random folks on the internet. No need and foolish. Google and your local LEO/DNR/F&G web site and their "contact us" link is a better place to ask.
In most states a situation where a reasonable man would be in fear of bodily harm to himself, another, a pet, or livestock is sufficient.
Suggesting that one wait until ACTUAL injury has occurred is foolish. Imminent injury is sufficient.
But given that dog owners may be likely to seek legal damages, the best approach would be SSS: shoot, shovel, and shut-up.
Any suggestion of SSS is generally an indication of doing something wrong, either legally or ethically. If there is sufficient proof of imminent injury or death, why would one need to hide any evidence? In the case of a dog attack, there is always a chance of Rabies, especially when the attack is done by a dog from an unknown origin with a lack of vaccination records. Why would one stupidly bury any evidence of a local rabies threat?
In those states where reasonable fear of imminent injury is a legal defense, those folks doing the shooting generally are protected against civil and criminal charges by the dog owners. Again, simple case of knowing your local/state laws.
As I said in my first post, I carry a gun when I walk my dog, not only for defense against two legged predators, but from 4 legged predators and dogs roaming loose. There is a certain amount of threat from all of them. But shooting a dog at the range of 20 yards/60 feet would be questionable as to whether or not there really was/is an imminent threat and would probably be questioned as such by LEOs and the owners of the dogs. At a distance where a bite could be made or where there is evidence of a attack, there would not be any doubt. Here's an example. Few years back, the local K-9 officer lived two houses down from me. His dog was very aggressive towards my dog and frequently attacked it to the point of even following my dog and 4 year old son into our house when they tried to get away from it. I complained several times to the local Fire and Police commission but got nothing but claims of being over reactive. Wasn't until I went to a board meeting with a torn pair of pants from an encounter on the street in front of my house, with witnesses claiming my dog was on a lease and the K-9 dog was loose, was there any type of action taken. 60 feet is halfway across our neighbor's yard. Even with prior complaints, I doubt very much if I would have been exonerated for shooting the K-9 at that distance.
But, an adult with a high powered, hi-capacity weapon should have little or no fear from two dogs in the woods. There is not much of a threat because the adult has so much firepower available and easily has the upper hand. Again, as I said before, I am not saying what the OP did was wrong or that he indeed was not afraid of being attacked. I'm only stating that I would have had to have more evidence of there being a real threat than a dog running at me from 20 yards away. I've watched my own dog, just a week ago, act very aggressively towards my oldest son as he walked towards the cabin dressed in full camo, face painted and smelling like a doe in heat. At twenty yards my GWP barked and snarled at him even tho they have known each other since she was a pup. She was only defending her territory. Altho she did not attack him, she did get to within 20 yards while acting aggressively. Once she realized it was him, she ran up to him wagging her tail and ran around him excitedly, licking his hand and sniffin' his boots. What was a threat @ twenty yards, was nuttin' at 5. Now, what if that bow hunter had been the OP and not my son and shot my dog @ twenty yards because she was protecting her territory from a stranger like she has been taught?
....maybe that's where the SSS comes in.