I was told in school and have heard the story many times since that Hitler was almost killed in WWI by an artillery shell. People normally state that this contributed towards him thinking he had a destiny. However, I can't find anything about it and have started to wonder if it's just an urban myth type thing?
Getting information about Hitler prior to the "Beer Hall Putsch" can be somewhat problematic because there has been a lot of contention over whether or not certain aspects of what Hitler claimed of himself is true. One of the top Hitler historians with high credibility, Professor Ian Kershaw, indicates multiple occasions upon which Hitler evaded death. In his book Hitler: A Biography Kershaw mentions this concept of Hitler viewing himself as destined by God for greatness and this perpetuation of him being immortal. Hitler was a trench-runner during WWI which was an incredibly dangerous job, all things considered. He would essentially deliver messages between trenches, which meant that there would be a lot of time spent where he could be picked off or hit with shrapnel from artillery. So it's probably safe to assume that there was at least one instance in which Hitler evaded artillery shells of some kind.
Some other instances in which Hitler evaded death come both before and after WWI. Prior to the war, Hitler had been living on the streets of Vienna and the fact that he'd survived in that manner for a number of years could potentially be what began that immortality complex of his. Regardless, it made him a survivor.
Looking at the Munich Beer Hall Putsch, Hitler managed to avoid getting shot while attempting to recreate Mussolini's violent revolution a few years prior. Meanwhile, a few or his fellow party members were not so lucky. Hitler got a very light sentence considering he'd been charged and convicted of treason (though he wasn't a German citizen yet, so figure that one out.)
Between his time of coming to power up until his eventual death, there were countless attempts on his life. There are many well documented instances of NSDAP members plotting against him.
Source: For more information on Hitler, I highly recommend the thorough, albeit lengthy, biography on Hitler by Ian Kershaw. That's where the majority of my information from this post originates. Let me know if I can answer any followup questions.