I’d either talk to them directly or get the association to pass out a note to everyone that they need to clean up after their dog and if they don’t it will be considered a violation of the HOA agreement. Or, however the HOA typically words such things.
I had a situation at my apartment where people where bringing their glass bottled beer into the pool. Idiots. I said something to people a few times. One time a couple with their infant baby got pretty annoyed with me and basically said to mind my own business. I went to the rental office and didn’t mention the rude, stupid, couple, but I did tell them I kept observing people bringing glass into the pool. They told me not to address anyone because it’s not my problem to deal with it. Eventually, they posted an additional sign right on the pool entrance gate about it.
The point of that story is sometimes if people aren’t reasonable enough to see what they are doing is wrong and they never will be without fear of punishment.
I had a neighbor years ago whose dog was coming onto my lawn and scratching the screen on my patio. When I told her she apologized and fixed it right away. I don’t think she realized he could get that far on his leash.
You have to kind of evaluate how receptive the people are going to be.