Kinda.
If you are firing out a window, most modern rifles will put a round through the wall you're hiding behind with little trouble. It's easier to aim a few inches below the sill at where center mass has to be than hit a head shot.
Buildings really aren't the protection people think they are.
A trench will protect you, sandbags or a decent berm will, but wood, brick or cinder block really doesn't do a very good job.
Helmets were designed to prevent shrapnel injuries, and fragments dropping into a trench. Most will not stop a rifle or machine gun bullet. They were a reaction to shelling, not sniping.
The nice thing about head shots is they make the guy fall down now. That's why you take one. Put a hole in a guy's torso and he will bleed out, but he may empty his magazine at you first.