My dogs do the same thing, indoors and out. I don't let them out alone if I think there is a chance they may bark. They also do it inside the house through the windows, if let up to them nobody would be allowed to walk past the house. I am in the process of breaking the bad behavior, what I have read is that you have to teach your do to do a non compatiable behavior, so let's say your dog barks at the fence, you call them over to you to sit, or you engage them in tug or war, anything that will take him away from the barking. You call him over to you have him sit and give him a cookie. I'm still working on it with my dogs, my trainer says teaching a dog not to bark at things is one of the hardest things to train.
Don't comfort your dog, if you say somthing like "it's okay" you are basically saying it's okay keep barking. Be firm and say no bark of whatever command you are using. Good luck.