Some movies portray executions of Nazi guards out of anger after seeing what they had done during the liberation of concentration camps. Is this historically accurate or did the Allied soldiers allow them to have proper trials?
I have also seen it portrayed where liberated Jews kill the guards and Allied soldiers allow them to. Did this ever happen?
Yes, Allied soldiers did summarily execute concentration camp guards or allow prisoners to do it themselves.
A famous example took place in the hours after the liberation of Dachau by elements of the 42nd and 45th Infantry Divisions. The remaining German guards (some SS but mostly Volkssturm militia made up of old men and Hitler Youth) had put up some resistance in the form of a short firefight, but they were quickly subdued and rounded up. However, when the Americans found several rail cars full of dead bodies, they began shooting the captured guards, by some accounts over 120 in total. Other guards were turned over to the prisoners, who made short work of them. The official 7th Army report of the liberation makes no mention of the executions, but many eyewitness accounts exist.
Mauthausen concentration camp in Austria was liberated by the US 11th Armored Division. The camp commandant surrendered the camp to the Americans, but many of the SS guards tried to flee and were shot by US soldiers. Other guards were killed by prisoners while in custody in locked cells awaiting processing as prisoners of war or war criminals. One American GI was standing around when a prisoner shuffled up to him and through gesturing asked for the GI's carbine. The GI complied, and the prisoner went off, shot several kapos (prisoners who acted as lower-level guards, often acting as the most brutal of all the guards), and then returned the carbine.
At Bergen-Belsen, the British captured about 50 Hungarian SS guards when the camp commandant handed the camp over to them (the German SS slipped out before the handover). Belsen was in the middle of a massive typhus epidemic that would eventually claim the lives of tens of thousands of prisoners. The British were incensed by what they found and forced the Hungarian SS to bury the dead in full uniform (under the hot sun) and without protective gloves to guard against the lice that transmit typhus, fully intending to work them to death. 20 of the 50 Hungarian SS died before higher British authorities intervened and had the Hungarians removed from the camp.
At Buchenwald, American soldiers watched (and in some cases aided by providing firearms) as the prisoners killed around 80 former guards who were trying to hide in prisoners' garb or in the surrounding forests.
Sources:
Abzug, Robert H. Inside the Vicious Heart: Americans and the Liberation of Nazi Concentration Camps. New York: Oxford University Press, 1985.
Bridgman, Jon. The End of the Holocaust: The Liberation of the Camps. Ed. Richard H. Jones. Portland, Oregon: Areopagitica, 1990.
Flanagan, Ben, and Donald Bloxham, eds. Remembering Belsen: Eyewitnesses Record the Liberation. Portland, Oregon: Vallentine Mitchell, 2005.
Hirsh, Michael. The Liberators: America's Witnesses to the Holocaust. New York: Random House, 2010.
Perry, Michael W., ed. Dachau Liberated: The Official Report by the U.S. Seventh Army. Seattle, Washington: Inkling Books, 2000.
Sacco, Jack. Where the Birds Never Sing: The True Story of the 92nd Signal Battalion and the Liberation of Dachau. New York: HarperCollins, 2003.
Shephard, Ben. After Daybreak: The Liberation of Bergen-Belsen, 1945. New York: Shocken, 2005.
Smith, Marcus J. The Harrowing of Hell: Dachau. Albany, New York: State University of New York Press, 1995.