From what I understand in my state, shooting a dog with a BB gun, a paint ball gun, shot gun with rock salt or ANY other way of harming a dog could be considered animal cruelty and it could be a fine and possible jail sentence. Now, that being said, if a dog is destroying your livestock or you are in fear of that dog, and it's on YOUR property, you may kill it with a gun (if you are allowed to discharge firearms in your area). The "trick" is you MUST kill the dog with the FIRST shot, no second shots, that would be animal cruelty because you only wounded the animal with the first shot.
Moral of this story is to make darn sure you KILL the animal. If he goes home wounded, you could be in trouble, no, make that you WILL be in trouble.