If it’s not a dog it will be a cat or a fox. You can’t really stop them from doing as they please.
What about the cheap low trellis style bordering? Anything to keep dogs on the path. If you can’t control the owner you can put physical suggestions for the dog.