I touched on this in another post, regarding dogs barking at Elka. However, it came up yesterday while I was at work, as well. A patron came in and said something to the effect of "I just stood in the rain for ten minutes with my dog hoping he'd go to the bathroom." I commiserated, as Elka does not like going potty in the rain. She continued, with a smile on her face, "Well, the last time, he didn't go. He's afraid of the groomer's, and won't walk back with her, so she picked him up, and he peed everywhere. Like a fire hose."
And I thought to myself, And you just left him there? What work have you done to make the groomer's a positive place for him? I did not preach to her, and sort of regret that I didn't try to go down that conversational avenue, but I doubt she would have welcomed it. Many peoples' attitudes when their dogs are legitimately afraid seems to be: deal with it. Also, many peoples' attitudes when you give them dog advice is: it's my dog. What do you know? Unsolicited advice is rarely welcome.
When I want Elka to go potty in the rain, I want her to "deal with it". When I want her to go someplace necessary but scary, I want her to be calm and realize it isn't the end of the world. She has never resisted going to the vet, and has always behaved well there. Below is Elka's "Oh God, it's raining on me!" face.
Recognizing when your dog is afraid is a very good start. Some people, apparently, think animals do not have emotions. I don't have scientific proof, but really, I beg to differ. If your toddler is afraid of something, you would try to reason with him or her and show the toddler it isn't so bad; it's hard to reason with a dog, but cases can be made. Hot dogs help. So does cheese. "Counter conditioning" is when you pair a good stimulus (treat, play, toy), with something "bad" or "scary" (lawn mower, barkind dog, the groomer's). You aren't rewarding the dog for being afraid; you are building an association between their perceived bad stimulus, and things that the dog likes. If you are diligent, soon your dog will turn to you when a dog starts barking in her face, or a lawnmower starts up nearby.
But, body language. A dog who is afraid will not have her head and ears up, typically. A dog who is afraid will not meet your gaze, but rather look away or look at you sideways. A dog who is afraid will be kind of curled in on herself, and depending on the level of fear, you may be able to see a good deal of white around her eyes (we in the business refer to this as "whale eye"). Below is Elka, after being terrified into leaping from a porch into my arms (the story of this is in my post The Social Question). She's pushed against me, away from the fear stimulus. Her ears are kind of cocked. She is looking away, as well. There might also be a "tongue flick" going on, a sign of stress.
If your dog is displaying fear body language, and extreme fear body language, it's up to you to figure it out and mitigate it. You're the owner, you're the "grown up", it's your responsibility. If your dog barks and barks at everything, but stops when it goes away, perhaps your dog is afraid of those things? In which case, barking is exceedingly rewarding; if the dog barks long enough, the fear stimulus goes away, which is what the dog wants to happen. I see a lot of this when walking Elka; 20ish pound floppy fluffy dogs barking and snarling, but whale eyed and turned sideways from Elka, not looking right at her. Elka will look at them, and then look back to me for her treat as she walks past with me at heel.
A dog who is experiencing strong enough fear may bite, as the prior warnings (barking, growling) were ignored. Such a dog is not necessarily aggressive (though "fear aggression" is a usable term), not is such a dog necessarily unpredictable. We humans just missed the signs, or punished the growling without looking at the cause. Growling is a dog's "polite" way to tell you "I don't like this. Please stop it." Escalation from there is because the warning was ignored, or the warning behavior was punished out of them. A dog who is punished enough for growling will no longer growl, but will still escalate, if it feels sufficiently threatened.
My ultimate goal is to have an inquisitive, confident, polite, and well behaved dog. It should, I feel, be everybody's goal. Learning about canine body language helps immeasurably like that. Your dog can't talk to you, but your dog is always "talking" to you. And it's up to you to do your best to listen.