How do you feel about me yelling at someone who yelled at my dog?
Why did they yell at your dog?
He was barking, and the person didn't like it.
It's fine to let the person know that they shouldn't yell at your dog, but I don't think you should yell at them. I think you should calmly tell them that it's not right for them to act aggressively towards your dog because that will probably work better.
Are you sure that humans get attacked by dogs a lot? Mine is very nice almost all of the time.
Humans get attacked by dogs a lot, but that isn't the point here and I think that you should respect that the person was afraid and not belittle them for it. At the same time, it is right to stand up for your pets and explaining to the person that your dog is harmless would be a better step than yelling at them back.