Gfted1's foolproof technique for dog attacks*:
(Note: You must not mind hurting the dog)
If it looks like your about to get mauled by a dog the best thing to do, imo, is to be the one deciding where you get bitten. With that in mind, when the dog attacks;
1) Stick out your forearm (they generally bite whatever is closest) and let the dog bite down.
2) Lift your arm which will expose the dog windpipe.
3) Punch the windpipe vigorously.
*Ive never actually had to do this but it seems like it should work.