You’re right, knowing your laws is very important. Murder is illegal, self-defense isn’t. If you’re defending yourself against a lethal threat (which a dog attack may very well be) and can articulate why you did what you did, it could easily be considered self-defense.
Most animal cruelty laws make it a crime to kill or injure animals “unnecessarily” or “without justification.” The most obvious justification is self-defense or defending another person from harm. That doesn’t necessarily mean, however, that you can shoot a dog just because it’s growling or barking at you or it has bitten someone in the past. The general rule most courts follow: You must believe it’s necessary to kill or injure the animal in order to prevent an immediate threat of serious injury—and that belief must be reasonable. (See, for example, Grizzle v. State , 707 P.2d 1210 (Okla. Crim. App. 1985).) Some states, like Georgia, have explicitly included this rule in their laws (Ga. Code Ann. § 16-12-40).
Understanding your state laws is very important, but remember there are a lot of nuances to how laws are interpreted. I would suggest anyone with serious concerns about dog attacks talk to a local self-defense attorney for clarification on the laws in their state.