Since Star Wars used aeronautical film as a backdrop pattern for the movement of space ships, this aspect of that movie would change. I think Lord of the Rings would be far enough into fantasy that it would change less. In the late forties, Hollywood discovered WW2 movies did not market as well as westerns. Without the world wars, battle-oriented stories would either be set in the past or would involve countries that were lesser developed. In the early 1900's, there was a thought process that the industrialized world had "outgrown" traditional wars, and whether that idea could linger for another century is questionable.
There's also the whole thing of the baddies in
Star Wars being
Stormtroopers fighting for a rather totalitarian Empire trying to crush liberty and democracy in a bid for intergalactic supremacy.
As for
Lord of the Rings,
The Fall of Gondolin was written in the barracks in 1917 and there's Mordor, described as "a barren wasteland, riddled with fire, ash, and dust. The very air you breathe is a poisonous fume" in the movies and, well, in the books...
"Here nothing lived, not even the leprous growths that feed on rottenness. The gasping pools were choked with ash and crawling muds..., as if the mountains had vomited the filth of their entrails upon the lands about. High mounds of crushed and powdered rock, great cones of earth fire-blasted and poison-stained, stood like an obscene graveyard in endless rows...."
Making a connection between that and No Man's Land is a bit of a low-hanging fruit, admittedly, but that particular description is evocative of artillery-scarred and poisoned wastelands riddled with countless bodies.
Though Tolkien did say "I cordially dislike allegory in all its manifestations, and always have done so since I grew old and wary enough to detect its presence. I much prefer history – true or feigned– with its varied applicability to the thought and experience of readers. I think that many confuse applicability with allegory, but the one resides in the freedom of the reader, and the other in the purposed domination of the author," it's fair to say that at least some of the imagery may have been inspired by what Tolkien witnessed during the war. And the loss of comrades and friends to all manners of horrific deaths (artillery, gunshot, disease, etc.) would doubtless have left its mark on pretty much any soldier for the rest of their lives. Writers do often search within themselves and use personal experiences to give life to their works, so I'd say that the
Lord of the Rings would be pretty different if it even existed without Tolkien going off to war.