35,000+ miles on a road bike and the best thing I found was to stop. Dogs are pretty much operating on instinct and to them a bicycle looks like a deer or some other sizable prey. That's why they tend to nip at the tires or run under the front wheel. They don't see a person until you stop the bike and say something to them.
On my bike today? Still messing with the wiring.