Firstly the owner should be shamed for educating his dog in this way.
Secondly, and i realize I am running the risk of sounding like a soft leftie pinko commie... But...
Don't be afraid of being submissive to the dog. Don't smile [bare your teeth], don't tower, don't hold eye contact and if you do have to retreat resist the urge to watch the dog, look past the dog at the ground, spot it in your periphery. And take the RayBan aviators off, you just look like a monster with mirrored eyes.... to a dog
If you are not confident or comfortable enough and would prefer a chemical protect-ant; citronella. To a dog this smells, well, like dog crap smells to us and your'r not going to create a legal issue.