Movement is the key to E&E
Very good info on the previous posts.
Lets keep in mind the primary objective: To stay alive.
Its not putting two neat holes in the A section of a cardboard target.
So to answer your question - It Depends.
Situational awareness is the key to survival in any of these "what if" scenarios. So if you are walking around an area look around, asses potential threats and potential cover if necessary.
This does not mean you walk from pillar to wall in everyday life, and not look at the pretty girls who pass by, but know your surroundings.
When the stuff hits the fan, and it is not initiated by you - get out of the area of engagement quickly - IF you can.
If in a scenario where the BG is zeroing in on you, and there is no cover - drop prone and return fire from the ground - most post-firefight analysis reveals that people fire high. So if you are on the ground, you have a better than above average chance of not getting hit.
Last note: Most objects DO NOT STOP or DEFLECT rounds. So standing behind that cube wall may stop the BG from visually sighting you but there is a good chance his rounds will zip right through it and hit you anyway. Lets face it, most civilian office furniture, and objects in the real world are not built to withstand 9mm, .45 rounds zipping through them.