If for example the Russians had built a trench system to defend against the German invasion why would it have failed where such tactics succeeded in WW1?
Essentially I am not sure why a WW2 army would be able to effectively cross no mans land where a WW1 army could not.
As far as I know a line of machine guns and artillery would cut infantry to pieces and blow tanks to bits just as effectively in WW2 as they did in WW1.
Technology and industrialization was the key to World War II avoiding the mire of trench warfare, but I would argue that this came about in a far more systemic manner than is typically described. The typical explanation seems to hinge on tanks and bombers breaking defensive lines, but the two most relevant developments between the World Wars were actually the widespread use of radios and the increasing mechanization of armies.
Radios returned flexibility to the era of mass armies. Prior to their advent, the fastest one division could communicate with another was if they were both parked on opposite ends of the same, immovable telegraph wire. The speed of their communications would be dependent on how quickly their telegraph operators could receive, transcribe, and relay pertinent messages amidst the hundreds of unrelated missives that passed through their sets. With a radio, General Halder could nervously order Generals Guderian and Rommel to cease their drive on the Channel and wait for their infantry complements to catch up. Whether Guderian and Rommel obeyed or not was a different story (the former performed an expressly permitted "reconnaissance in force" with his entire division; the latter simply switched off his radio and fell off the maps until he'd accomplished his mission). The point is, forces in the field were no longer forced to stay tethered to the telegraph in order to properly coordinate actions with one another, and this made an incredible difference in what is now called operational tempo.
Mechanization meant a number of things. First, the widespread use of trucks meant that armies had a much larger operational range from their railheads than they did when entirely reliant on horse-drawn wagons. The North African campaign would have been wholly out of the question if it had not been for Ford trucks motoring back and forth across the hundreds of miles of desert between the last railhead and the forces they were supplying (yes, the Germans used Ford trucks too - they captured them from British supply depots). This is not to say that horse-drawn supplies were not used - they still made up the majority of supply runs from railhead to front, especially on the Eastern Front, but the use of trucks enabled the operation of mechanized units relatively far from the railhead supplying them.
Second, mechanized units were powerful because they were fast. Here, I speak not of the individual speed of a tank, but the operational speed of an entire mechanized division. A mechanized force could advance at a mind-boggling operational pace and still retain immense combat ability through mobile tanks and truck-transported infantry, unlike an infantry unit without transport which would simply run itself into the ground. This meant that a mechanized schwerpunkt could shift its focus at a far more rapid pace than an infantry force could adapt. The speed at which a mechanized division could find and exploit a weakness, especially given the previously mentioned ability of the radio to significantly shorten a decision-making process, was deadly to the inattentive defender. Seven divisions of infantry moving through the Ardennes in 1940 would have been a problem, but one that the BEF and French Army could have easily met and countered. Seven divisions of armor, however, sealed the deal with their operational speed, with the Western Allies realizing what was happening in time to mount only the most perfunctory of counterattacks before complete encirclement.
Let me emphasize again that it was their speed and combined arms cohesion, not their armor or armaments, that made mechanized forces so powerful. Time and time again the idea of tanks as an invulnerable battering ram had been disproven, be it in the Spanish Civil War where tanks tended to die very easily to anti-tank guns, or the failed British and French counterattacks against the German encirclement in 1940, or the totenritt of the starved 21st Panzers at El Alamein, or the horrific waste of the German Operation Citadel at Kursk, or any of another dozen examples that can probably be found in the records.
The third implication of mechanization I'll mention, was negative: Mechanized forces were expensive, both in initial capital and supplies. They were powerful in their speed, but few in number, and it was disturbingly easy to lose an entire division of tanks and their supporting motorized or mechanized infantry if they ran out of supplies. A tank without fuel for a day was a stationary pillbox / target for aerial bombardment. A division of Infantry (Motorized) that was cut off from supply reverted to a footborne Infantry division after a little while longer. Just as mechanized forces were easier to supply using trucks, it was far more critical to supply them. No better example can be shown than that of the failed Soviet offensive at Kharkov, where two armies and three corps of mixed tanks and infantry were cut off and slaughtered as they ran out of supplies. The Germans were even able to salvage Soviet equipment - the tanks and trucks had run out of gas and been abandoned in the Izyum Salient after their supplies were cut off.
In summary: The ability of radio-coordinated mechanized forces to maneuver in concert was what made trench-warfare untenable for most World War II fronts. These mechanized forces existed at the end of a long supply line, capable of operating at far greater distances and far greater speeds than previously possible. With the exception of particular arrangements of geography (the Carpathian Mountain / Pripet Marsh bottleneck in Ukraine, the narrow Crimean Peninsula forcing Manstein to commit frontal assaults, the salty wastes of the Qattara Depression preventing maneuver against Montgomery's 8th Army in Egypt, sheer unabashed weight of 6-inch shell fire at Salerno), a mechanized attacker could always potentially outmaneuver the defender. These mechanized forces were fragile, though, supplied by a shoestring that was deadly if disrupted, meaning that the primary goal of major mechanized formations was often to simply cut off the supply of their enemy equivalents so they could then maneuver at will against the remaining footborne infantry.
TL;DR: Radios and Mechanization:
Radios increased operational tempo and enabled fast, fluid decision-making on the fly.
Mechanization enabled blistering operational speed, allowing incredibly fast concentration of force against weak areas of the front.
EDIT: I forgot to indicate my source, didn't I? Most of this post is drawn from a detailed look at German Operational Warfare in Blitzkrieg to Desert Storm: The Evolution of Operational Warfare, with supporting examples drawn from readings about German decision-making from 1940 to 1943.
There were many instances of trench warfare and static frontline, esp. on Eastern Front - some examples:
USSR
Polar Front (1941-1944) - near Murmansk. Not much movement for many years. There were places where german troops didn't manage to get over USSR border. Climate and terrain made quick maneuvers impossible.
Siege of Leningrad (1941-44). Germans didn't manage to take Leningrad quickly and battle devolved into trench warfare. Several german assaults failed and several soviet attempts to de-block the city failed too. Bloody battles for small advances were typical and quite similar to WWI. Terrain (swamps, lakes) was certainly a factor.
Siege of Sevastopol (1941-42). Only after germans brought in heavy artillery, disabled naval batteries and managed to repel counter-offensive to de-block Sevastopol from Kerch side, Red Army evacuated this important naval base.
Germany
Rzhev-Vyazma (1942-43) : static front and several failed attempts to break thru with staggering losses. Germans were bleed dry too in the end.
Miuss-front (1942-43) : germans successfully defended it for ~1 year, several Red Army attempts at breakthrough in 1942-43 failed.
Kourland Kettle (Oct 10, 1944 - May 15, 1945) : 5 attempts to storm it have failed.
I am not sure why a WW2 army would be able to effectively cross no mans land
Recipe is : properly used tanks, massive artillery barrages, air bombardment and combined arms assault groups will break any defense. Trench warfare happened in WWII when some components were out of proportion.
Another secret ingredient: it became possible to quickly concentrate motorized forces at critical points, achieving overwhelming advantage locally to break thru quickly, while defenders scramble to bring in reserves. It put entrenched defenders at huge disadvantage.
Ferrard's answer is an excellent one.
If the Russians had built a trench system, here's what would have happened: At appropriate points identified by aerial reconnaissance, the Germans would have bombed, shelled and assaulted, using tanks and motorized infantry and punched through. They would not have tried to break through on a wide front, but merely punch through (concentration of force versus a force that is well spread out) and then encircled the entrenched force, cutting them off from supply. That force, surrounded, can then only engage in a desparate holding action, and be crushed, or surrender. While that is happening, the armoured spearheads push on, and do the same again to successive trench lines.
There would not be a No Man's Land to cross, because the Germans would never have entrenched.
While machine guns are very handy at protecting against infantry attack, they are not a perfect solution, and even infantry crossing No Man's Land on foot can still make progress. Artillery is the real infantry stopper, and it's not so useful against point targets (like tanks). Think about how influential tanks were in WWI. Now they are faster, better armoured, better armed, more co-ordinated, and they have lots more infantry following up at speed in trucks or half-tracks. Linear defence is simply not an option any more.
Patton said that (paraphrasing here) fortifications were a monument to human stupidity. And in WW2 it was true. Your No Mans Land would get bypassed and the armies on the other side would get flanked. Check out the Battle of Kursk where instead of a defensive line they had a strategy of Defense in Depth where you keep whittling down the attackers like a version of Plants VS Zombies. Still even though it was pretty much a Soviet Victory they lost 4 times as many men as the attacking Germans and they KNEW when and where the Germans were attacking. Combined arms had made sure you could always punch holes through a defense.