As noted above,, animal cruelty can become a big issue quickly. To the point of legal action against you. I suggest you research animal cruelty laws prior to using anything.
Non-lethal methods are preferred.
As noted,, a wrist rocket can be an easy way to possibly dissuade a dog from visiting a piece of property if it learns that a sudden sharp non-lethal pain results. Use an object that won't cause any damage,, such as a paintball or other biodegradable item.
And even if the law says something like; "An owner of a dog is responsible for the dogs actions off the owners property" doesn't automatically allow cruel actions.
BB guns can penetrate the skin, requiring a veterinarian to remove it.
NC has a law like I mentioned above about owners responsibility. We had a problem many, many years ago with a person who failed to keep their dogs up & out of our garbage, and they would crap on the property as well.
Calls to animal control were not effective,, as they had a long backlog of complaints. After over 6 weeks of no action, and my mother's dog caught the parvo virus & almost died,, mom told me to "Burn their butts," when I saw any dogs on the place.
A total of (6) dogs were popped with a mild load of 3 pieces of buckshot in a Speer shot shell in a 38 spl. That cured (6) dogs. However,, dog #7 happened to get hit with a different load. (my mistake.) It was hit from about 40 yds with an inverted HBWC.
That dog got a serious wound. It went to the vet. The police were called. While the police chief was telling me that the dog's owners were likely going to file charges,, one of their other dogs showed up on the property. I was later arrested for animal cruelty. My mom paid for the lawyer, and testified in court of all the problems we'd had with loose dogs. The police chief testified he saw the loose dogs on the property. Animal control testified they had not been able to get to our property, despite (4) calls by my mother asking for help. The case was dismissed.
BUT,,, it cost money, and I was charged.
My point is,, use a non-lethal approach to dealing with issues. Even if the law says you have certain rights, doesn't mean you will not be charged.