There is tremendous scholarly debate on this very question; particularly in the last few years. The major factor in the fall of Rome was, of course, the Barbarian migrations. ("Barbarian" was a term originating with the Greeks, who said that the language of the German tribes sounding like the sounds of sheep.) The Roman Empire had grown so large that it's borders were tremendous, and difficult to patrol. Now, let's muddy the water a bit. In the year 376 (one hundred years before the end of Empire) the Romans allowed the Goths to cross over to escape from the oncoming Huns. This in essence opened Pandora's box. The Goths continued to stream over, and occupied Roman lands. Needless to say, they did not pay Roman taxes, which reduced the Empire's income. The Huns themselves were a factor. The Romans had a tenuous relationship with the Huns under Attila, which mainly consisted of the Romans buying them off.
Then there was internal strife within the Empire. Roman armies, since Julius Caesar, were loyal to their commander, who typically (but not always) was the Emperor. (Another little known factor: the Emperor himself was known as the "Augustus," his successor as the "Caesar.") During a time of dissension, there were as many as four claimants to the throne, all supported by their troops. Out of 27 Emperors, only one actually died of natural causes. The others were either murdered or committed suicide.
To muddy the water even further; Germanic tribes often fought in the Roman Armies as mercenaries. They often sided with one General or another, generally with the highest bidder. Finally, when a General named Orestes installed his son (a feeble minded teenager) as Emperor, (Romulus II Augustulus) the Germanic General Odoacher put an end to the nonsense by having Orestes put to death, and forcing Romulus to abdicate. He then forwarded the crown and purple robe of the Emperor to the Emperor in Constantinople with a letter that he was the sole Roman Emperor now.
So, the variables would be internal dissension, Germanic migrations (invasion is probably too strong a word) the pressure created by the Huns, and the sheer size of the Empire. Could it have been prevented? Probably, but to do so, the process would have had to be modified at least 100 years before the actual collapse.
Several excellent sources you might consider: Adrian Goldsworthy: How Rome Fell, Death of a Superpower; and also Christopher Kelly, The End of Empire: Attila the Hun and the Fall of Rome.
Of course, we can never know for sure if history could have happened any other way. I would argue, though, that the way the Roman Empire was set up made it very likely to fall. Let us look at a few reasons for this:
- The Empire was too big for its time. This was a time when communication and travel was slow. An empire that big was very difficult to rule. The armies in the field had to have a lot of power and that allowed their leaders to become very important and to have dreams of becoming emperor. This sort of thing led to many of the fights over the throne that helped to ruin the Empire.
- The size of the Empire also brought it into conflict with many outside groups. The fighting was expensive and hurt the Empire's economy.
- The economy was not that great and was based on slavery. This made it so that there was not much of a middle class -- mostly very rich and very poor. That reduced the strength of the economy, which made citizens less happy and which made it harder to fund the armies.
Because of these things, it seems that the fall of Rome was inevitable. But we can never be sure.