That is terrifing and dangerous not only for the person but the dog too.
I get scared when we are out walking and a dog comes charging straight at us across the yard and no fence.

Never leave your dog alone in an unfenced yard.

Someone will hit your dog trying to protect themselves.

Get your dog on a leash and next time a person comes along and goes at them, Step on the leash and make it short and say LEAVE IT at your dog. Keep doing it over and over again.

Or get one of those dog tie ups that you can put into the ground if your outside with your dog and so he can't get away, he's grounded and you can do gardening or whatever you are doing.