As someone who's taken quite a few trenches, the key is response time. You CAN dodge bullets in this game - but you need to watch the whole field, and the moment a bullet starts coming in your direction from either side, begin evasive maneuvers. Watch the trenches, not your character - thats where bullets come from. Of course, you also need to watch your character, since artillery and gas can drop at any moment. And the side of the screens, for bi-planes.
Only go out during the lulls, and get out as soon as the enemy or your troops start retreating. Stay away from clumps of units - they tend to draw fire. Rescue those closest first - you can rescue more people that way, and your troops respawn rate is determined the by number of people you rescue. If a side or large chunk of the map is cleared during a dogfight, it's occasionally safe to go out, since you yourself barely draw fire... but its always a gamble, expect to dodge some bullets.
Stay away from gas. It lasts longer and reaches further than you think it does.
Watch out for bi-planes - they are your worst enemy, but you CAN occasionally see them coming, and respond appropriately. Usually this means moving up or down just a bit, but the worst is a trench run. If you see your men dying due to a bi-place? GET THE HELL OUT OF THE TRENCH, NOW.
Finally, people you can save twitch a little bit. Wrap up any enemies you find on your side of the map - they won't respawn until they die or are saved, and this means every medic-ed enemy is one less soldier they will have for the next two waves (if you hit them soon enough). I tend to prioritize this over saving even my own units. (Which I credit to how often I take trenches)
All of this gets harder as the battlefield gets more cluttered, so taking trenches is great.