It's an unfortunate situation. If you catch someone in the act you have to confront them head on.
A couple of years ago I had an altercation with a middle-aged couple whom I caught permitting their dog to foul a green area near my house where children frequently play on. I had previously spotted them 'at work' the previous month but was in someone else's car at the time.
When taken to task, they tried to brazen it out and when that didn't work, the man decided to throw a punch at me. Luckily I possessed a modicum of self-defence skills and easily parried it while delivering a return blow to his jaw.
While they left the scene without attending to the mess, they have not been back and the problem has righted itself. As there were several instances of dog dirt in the vicinity prior to our encounter it can reasonably be assumed that they were responsible.