In terms of narrative an allegory is defined as one which gives a meaning other than the literal one represented by the narrative itself. For instance, 'The Lord Of The Rings' is a narrative based in a fantasy world (purported to be before the existence of modern man) where a group of characters (of different races, cultures and skills) are brought together in order to protect the innocent Frodo as he travels to Mount Doom in order to destroy a powerful ring. A ring which corrupts many who possess it, and so in his quest he is not only destroying its immense power but protecting others from its corruption. As an allegory the story can also come to represent certain other meanings or moral teachings.
Tolkien wrote 'The Lord Of The Rings' as a follow up to 'The Hobbit', a fantasy novel he wrote for his children. Originally began as a simple sequel it soon developed in scale, taking from 1937-1949 to write. With a large amount of the work being written during World War II. Because of Tolkien's age (being born in 1892) and living through both World Wars (serving in the first) 'The Lord Of The Rings' is often seen as an allegory for events that took place in this time. However, there are alternating versions of this suspected allegory.
INDUSTRY
Many have seen 'The Lord Of The Rings' as an allegory for the industry revolution, with the Hobbits representing farming people. Determined to protect their way of life by destroying the ring, seen here as a representation of technology. With the other characters representing various powerful figures who would seek to possess the power, the technology. But ultimately being corrupted by the power which it offers. Similar literal themes are present in the works of D. H. Lawrence. Where industry is seen as threat to the 19th century farmer's way of life.
WORLD WAR
'The Lord Of The Rings' is also seen as an allegory for war. With the ring once again representing industry or technology, but in this case, military technology. As the warring side with the better technology inevitably represents the side with the greater power. With Sauron and the people of Rohan acting as the opposing sides in a war for ultimate power. However, whereas Sauron desires the ring for the power that it offers. The people of Rohan simply seek to keep the power from those who would use it unwisely (I.e. Sauron). But despite being written during the years in which World War II was taking place Tolkien denies any resemblance in 'The Lord Of The Rings' with the war itself. In fact, he states that World War I (in which he served) had a greater emotional effect on him. So maybe it is possible that the 'The Lord Of The Rings' could be an allegory for the World War I. Indeed, the fact that World War I was conducted predominately in farming territory by people who were largely innocent to the evils that awaited them, suggests that it is more likely that 'The Lord Of The Rings' is an allegory for World War I. As this story is more akin to that of the Hobbits.
THE ATOM BOMB
Once again pondering the ideas of industrialisation and war, many believe that the 'The Lord Of The Rings' is an allegory for the fight to develop and implement the first atomic bomb (itself being a major development in technology and also a major part of World War II). With the ring itself literally representing the atomic bomb. With Sauron and his opposers literally fighting for the power with which to terrify and control all those in middle-earth.
CONCLUSION
The fact is, is that 'The Lord Of The Rings' has many different meanings for many different people. Some may see Gandalf as something of a godlike figure. Some see the Hobbits as the innocent public in a war between national leaders. The theories that abound about 'The Lord Of The Rings' are as varied as the people themselves. The majority of people believe that 'The Lord Of The Rings' is about the fight between good and evil. Whether it be between literal good and evil, in terms of war, or whether it be in terms of spiritual good and evil, with 'The Lord Of The Rings' representing a theological inquiry. In the opinion of this writer 'The Lord Of The Rings' is about doing the right thing, it is about selflessness and sacrifice. Those that believe in the danger of the ring and their beliefs in Frodo sacrifice themselves to unknown forces in order to protect Middle-Earth from evil powers. Samwise Ganges is especially important in this story, as are Merry and Pippin. They are innocent in nature and physically unable to embark on such an adventure as is the journey to Mount Doom. However, they go in order to protect their friend and because they believe in what is good and important. Samwise, I believe, is the most important character in the story. This is because, despite his doubt and his obvious fear he stuck with Frodo. He was strong and brave and put up with hell and high water to make sure Frodo stayed alive. And inevitably Samwise was the man who didn't gain any power, he didn't want any power, all he wanted to do was to return to The Shire and live happily ever after. 'The Lord Of The Rings' is an allegory for staying on the side of good, and doing what you believe to be good, never mind how hard that might be.