Depends on the neighborhood. You have to live on 10 acres, or more, in certain designated ag districts to be allowed to hunt varmints with a gun.
If you can hit it with a squirt gun, it's in Handgun range and if it's attacking your dog, it's self defense.
If one attacks my Bichon, it's dead, then I hunt for his buddies and they all die.