While walking down a quiet countryside track the other day, minding my own business, I was sort-of attacked by an off-the-lead dog, so I am all in favour of this.
When I say 'sort-of', I mean that the dog and its owner were walking towards me, the owner on the opposite side of the track from me but the dog on my side. When it reached me, it suddenly became very aggressive, and made as if to bite me - its mouth did make contact with the back of my leg, but fortunately nothing more. Meanwhile, the owner smiled as she passed me, as if nothing had happened. I glared back.
Just as well that's all that happened, as this would not be a good time to have to seek medical attention for a bite!