The owner was totally out of order. He shouldn’t have let his dog on your garden - it’s private property and I think you had every right to object.
We have an extra wide driveway as we have to drive in sort of on the slant and its open to the path. One gatepost is used by every passing dog as a pee post. They like to leave messages for each other and we have no objection as we realise this is just what dogs do. However, if the owners were to let their dogs wander into the rest of our garden (which is planted) I would object - loudly.
I have owned dogs and now walk our (male) granddogs. I would never ever let them into someone’s garden and keep them on a tight lead when walking the local open plan estate roads. It’s not difficult.
Do you think you know when you are going to die?
