Most dogs are quite predictable, if you just pay attention to them.
Here in downtown Richmond, VA, we're lucky to be near a river that remains relatively unspoiled. (Interactive Map of the James) Herons, eagles, all sorts of birds live nearby and fly over. Raccoons, possums, squirrels, voles, bunnies and chipmunks are common sights. Occasionally a fox or coyote, and every few years some deer, take a wrong turn through the neighborhood, and Fletcher never has any trouble figuring out which of those are predators, and what degree of response is appropriate. There's one exception for a specific squirrel, but that guy is asking for it.
Meanwhile, my dogs have always had to adjust to urban sights and sounds; loud voices, car horns, squealing tires and children, bicycles, skateboards, booming music in passing cars. Although some neighborhood dogs will bark at any disturbance, my dogs have always been specific about what they'd consider a problem worth reacting to, with heavy preference shown in favor of small children, and extreme antipathy towards any number of men when unaccompanied by a woman or child. Loose dogs are handled on a case-by-case basis, but they are usually strongly encouraged to move along. The garbage men are evil, it's best to lie in wait for them and barking at them works every. single. time.
Key to both restraining his reactions for the comfort of my neighbors, and recognizing what he's reacting to, is that I look to see what he's barking at every time. He needs guidance to understand what I consider a threat, and how I want him to respond, and since barking to warn of approaching threats is part of what dogs do, I praise him every time as well. As he reports back to me, is acknowledged and praised, he's also given a "that'll do" type of command, to let him know I've seen it and he can stop barking now. This is far more important a command for city dogs than country dogs, and has more noticeable effect on a naturally obedient breed than on independent guardian dogs like Fletcher. Sometimes he disagrees with me on how harmless a passing individual is, and disobeys me to - at least in his mind - protect me despite myself. It can be challenging at times, but we trust each other, and that is a precious thing that I consider an honor, so I try to live up to his trust by being respectful of his opinion on that dog, or that guy, or that big storm.
We've had quite a few destructive storms in Fletcher's 6.5 years, and the sound of chainsaws is common. Big trucks come and pick up debris, strange men shout back and forth with rumbling machinery, cherry-pickers appear in the trees along the alley. I've made a habit of walking out and greeting some workers through the fence, sometimes even go out to shake hands, especially if the crew will be there for a few days. I always come back and let Fletcher smell my hand, smile, and often say 'oh, here's my friends' as they arrive. His reactions at the door or fence line are always fierce to strangers, but he'll stop barking, drop to a steady low growl and settle to watch, which is ideal, in my view. :)
As long as I'm not concerned about the goings-on with city trucks, street sweepers, fuel oil trucks, etc; the reactions stay pretty consistent: Alert on first awareness, discernment of what is approaching, and if it warrants it, leap to feet followed by a run to whichever window or door or fence corner is closest, then either barking or a quick acknowledgement that he recognizes who or what ever it is, and finally a return to comatose on the floor. His "tone of bark" is extremely distinct and understandable, he is quite clear how much of a threat he considers something to be, so his reactions are quite predictable. It's especially easy to tell if it's someone he loves.
His body language is easy to read too, and that's useful whenever other people or dogs are present. He has a relaxed smile, ears down, and tail waving gently when he plans to approach slowly and greet happily. Someone he's not sure of and any dog he doesn't know still get a tail wag, but it's held high over his back and only the end moves, quickly. His usual gentle gaze is replaced with a tense stare, head up high and back straight, shoulders flexed. Sometimes he lifts one paw as if pointing. Seeing any of those negative reactions while walking would prompt me to call him to a sit and hold him there until the approaching dog moves away. Watching your dog's reactions around the house can help considerably in your relationship with your dog. Here is one set of photos with some typical body language, you may recognize some of these.
Keeping high-value treats in my pocket helps to reduce the undesirable aspects of Fletcher's reactions, especially when we're out walking and an unleashed dog approaches. I do want him to protect me, and do trust his judgement on people. With dogs, I'd prefer it if he were less dog agressive, and due to his size and strength, any interactions could be bad for the other dog, so I avoid them. Ideally, he sits when asked and watches my face, waiting for a treat or another command. Consistent reactions on my part are critical, sometimes I have to touch his side or loop the leash to me hard to get his attention when he's really in guard mode, but drawing his focus back to me regularly works to calm and redirect him. Sometimes in the yard, I even have to sharply inhale in disgust, frown, and walk away, and if he comes instantly, I'd better have a treat, but he's much calmer now than even a year ago. At age 6 he has reached another maturity milestone with noticeable increases in wisdom, patience, restraint and discretion.
This morning, in between impressions of a rug, we've seen a ferocious, sudden leap to the window, with teeth bared and snarling, when the off-leash dog with the hostile owner went by. A tooth click, followed by a leap to look out, with tail wagging and soft grunting sounds at the 2 little girls with their mother going to the park. A few minutes ago, a huge diesel truck with an extending hose attached to an arm, 4 crew members and a very loud vacuum arrived, backed beeping up to the curb, and started pumping mud out of the overburdened storm drain. Fletcher, lying between me and the window, hasn't opened his eyes, just made one little snarly growl, and otherwise is apparently dreaming of taking a long easy trot on a trail somewhere that smells really good. :)