We walk our neighborhood daily. We learned a trick from our mailman a few years ago about dogs that aren’t well behaved. We bring dog biscuits with us and throw them away from our path. Works like a charm.
Cat turds work as well and act as a deterrent to the owner.
When I was a mailman in early 60’s, we actually walked door to door on 6-8 mile routes daily. No spray or other defensive items yet. I had a German Shepherd lunging through a screen door trying to get at me. I jumped a fence just in time and the house didn’t get it’s mail.