I remember dogs running loose all the time as a kid before leash laws were introduced. Cops were not shooting them. It was the dog catcher's job to catch them. A loose dog is far less dangerous than a loose gang banger. With your logic, why not approve the cops shooting loose hoodies running at them?
A dog attack is not much different than being attacked by a human with a knife. You can stand there and try to judge their intentions but have to react fast if charged otherwise you are in serious trouble. If an armed thug charges a cop, I hope the cop is able to draw and shoot him before he is attacked. No different than with a dog.