My really long runs go into the local farmland. It's quiet, and flat enough. I've tried running beside the highway, but the camber of the shoulder made my ankles ache. The farmers don't generally tie up their dogs. Most of them keep to their yard. That's what they are defending -- it's their territory, so you're safe on the road. Some will venture out.
Normally my policy is to take off my sunglasses and avert my eyes. If you look at them, it's a challenge, and they bark. If you're wearing sunglasses, you look like a giant insect, and you're looking at them. . Dogs just hate to be looked at by strangers.