Well if your in the street and see a dog loose coming your way, CASUALLY cross the street, if the dog is coming towards you , and trying to approach you even though you have done that do not look at it, put your hands in your pockets or better still FOLD your arms togeather and look up and carry on walking normally.
Its best not to confront it with a SHOOO ! dogs normally only attack for a reason, so it would be quite rare that a dog would just run up to you and attack you out the blue.
but if it happened try to stay in control, screaming and getting panicked will only work the dogs attack up in more of a frenzy.
If its attacking you , pinch its nose as hard as you can. poke its eyes, try to hold it with both your hands round its throat , your thumbs behind the back of its head and your finger wedged under its jaw bone, untill you can get help, this restrains the dog and could make it calm down once it realises you have over powered it, talk to it FIRMLY , demanding it to stop.
I used to work with dogs before so I had more than my fair share of attacks !
To over come fear of dogs start of by socialising with them, go with a frend who has a dog to a dog training class , find someone who has got a pat dog or a has a trusted freindly dog that you can aquaint yourself with to build your confidence with d0gs, once you get to know most dogs are freindly you will really come to love them.