While shooting a dog in self-defense will certainly attract police attention, I think the chances you'll be arrested are much lower than shooting a person. As always, do whatever you can to avoid shooting, if possible. But if your choices are limited to being attacked by a vicious animal (canine or human), or using deadly force to defend yourself, then defend yourself. The legal consequences, if any, are not as bad as being mauled or killed.
You should seek out a CCW class in your state; they will educate you in the legal standard for the use of lethal force in your state. There are a number of books on the subject that you may find helpful as well; I still like In the Gravest Extreme
, by Massad Ayoob, even though it's a bit dated.