Suppose that I'm a British soldier on the western front of WWI. I'm doing my third two-week long "tour" in the front-line trenches of a hot zone, and I'm done with it. Maybe I speak a little bit of German, or maybe I don't care if I don't; I'll take my chances. I want to surrender/desert/defect.
How would I make my way over to the German lines without being shot to pieces the second I stick my head above the trench wall? Was such a thing even possible?
The question occurred to me because I recently read an account of a Russian officer surrendering to the Germans (I know the eastern front was a different animal), and from what I understand there was some degree of fraternization that occurred on the western, particularly between the Germans and the British (the Germans and French had a more personal beef).
Firstly, it didn't take long for the long trips to the trenches to stop during the war. Studies of combat fatigue were in their infancy during the war (collected under an umbrella of war neuroses), but commanders reported very quickly that their soldiers were suffering after long stays in the front lines. This led to stays usually of several days at a time, with fairly long periods in reserve trenches (less dangerous) or in support (i.e. well back). But the "hot zones" as you call them were still extremely trying according to the testimony I've read--places like Ypres, for instance, were in a state of almost constant assault on a minor scale, plus the more famous battles there. Most of the front was pretty calm much of the time, however, though not necessarily lacking danger of course.
Anyway...
Tony Ashworth has written a book called Trench Warfare, 1914-1918: The Live and Let Live System. While he glosses over the frequent raiding and antagonism, he nonetheless sets the gold standard for assessing how ostensibly "enemy" units were able to act in mutual interest. Informal truces were more common than one might imagine, usually meaning promises not to attack one another, but occasionally allowing people to leave their trenches under a white flag in order to collect the dead/injured. I haven't come across much in the way of surrender in my research though, other than people being captured during raids or attacks. So I'm not sure how feasible it would have been to fly a white flag, walk across No Man's Land, and simply surrender to the enemy. Not only might they shoot you, but your own allies would be able to see it as well, and probably wouldn't take too kindly. I've seen second-hand testimony in soldiers' letters talking about German POWs being interrogated, who had allegedly surrendered (as opposed to being captured), but nothing first-hand.
As for defectors, that's actually an interesting question. I'm not sure how often it would have happened among enlistees (i.e. actual turncoats), but certainly it's possible since it probably happens in every war. But certainly there were national defectors in many places. In North America, for instance, there was a significant German and Austro-Hungarian population, and enough of them went back to the fatherland that it caused quite a stir. It also provoked the passing of wartime laws that resulted in large-scale internment, some of those camps not being decommissioned until years after the war had ended.
[edit to add one detail I forgot, and correct some grammar]
What's already been posted here provides some good information but I think its worth exploring this theme a bit more. This is a great question as it looks at what is an oft-misunderstood part of WW1, namely the camaraderie of opposing soldiers in the trenches. The story of the Christmas truce is famous and stuff like this, while touching, paints an overly rosy picture of the realities of the war.
If you were going to give yourself up to the other side you had to weigh your options. On the one hand, you might like your chances of being treated humanely by your captors. The Hague Conventions forbade killing a prisoner and many were aware of the benefits of having the enemy be reasonably sure he would survive after surrendering. After all, if you've surrounded an enemy position but have a reputation for prisoner killing then your foe is much more likely to fight to the end. Furthermore the image of numerous enemies with their hands up is good for morale. As a result of this line of thinking taking prisoners featured prominently in wartime propaganda. A 1916 British propaganda film on the Battle of the Somme prominently featured footage of Germans surrendering. Sergeant Alvin York's famous capture of 132 enemy troops in 1918 was one of the most famous American pieces of WW1 propaganda. Planes would drop leaflets on German positions saying that life in Entente POW camps was pretty good, certainly better than sticking it out in the trenches.
Clearly surrendering was common enough (at least from the Central to the Entente, I don't know much about the other direction) that the military leadership was willing to pursue efforts to make it happen as much as possible. But the question of how to go about surrendering remains. So does the question of whether it really was the best option. It's a sad reality that there was deep hatred on both sides. Numerous accounts survive of soldiers killing prisoners and doing so with an extreme vengeance. On the western front this was not just a Franco-German phenomenon as many British soldiers were involved as well. Now of course this did not happen in the majority of cases. Many soldiers were taken prisoner and were treated humanely. However, the fact that some were subjected to abuse and even murdered would have certainly acted as a deterrent to laying down one's weapons.
In terms of how you'd go about it, as far as I can tell there was no uniform way of giving yourself up. From what I've come across once a position was taken by the enemy then those who wished to surrender would just come out with their hands up and perhaps plea for mercy. One account speaks of defeated German soldiers surrendering while holding pictures of their wives and children in the hopes that this would incline their captors toward clemency. Again, it's hard to figure out just how surrenders took place.
I hope this has addressed some of what you wanted to know. I realize I've been a bit hazy on just how a surrender happened but hopefully someone else can help paint a more complete picture. In terms of just how many men surrendered on the various sides I do have some interesting figures (although I don't have anything on desertion). Nearly 16% of all Russians mobilized during the war ended up prisoners. Captured men accounted for a third of Austrian and a quarter of Italian casualties. In March 1918 the British lost about 100,000 men to surrender, the worst month for the British in this category of casualties. The most dramatic surrenders were on the German side, with the number of German soldiers in British hands rising by a factor of almost four from July 30 to Oct 21 1918
I have based this answer on the relevant sections of Niall Ferguson's The War of the World. I can't recommend this book enough.