Near death experiences [NDE] and out of body experiences [OBE] are common. Some people believe that they see a 'tunnel' and they interpret that tunnel as a form of transition from the physical world into the world of the afterlife. Some people think that they are consciously removed from their physical form and float above their own bodies.
That's all very warm and cosy. And extremely unlikely.
A far more likely explanation is that the experience of travelling down a tunnel is attributable to biochemical and neurophysiological causes.
It is well documented that the hallucination of flying is triggered by atropine and other belladonna alkaloids. OBEs are easily induced by dissociative aesthetics such as ketamines. Others are:
Dimethyltryptamine [DMT] – Causes the perception that the world is growing or shrinking;
Methylenedioxyamphetamine [MDA] – Stimulates the feeling of age regression so that things we have long forgotten are brought back to memory;
Lysergic Acid Diethylamide [LSD] – triggers visual and auditory hallucinations and creates a feeling of 'oneness' with the cosmos.
The very fact that there are receptors in the brain for such artificially produced chemicals demonstrates that the brain, under certain circumstances (such as the stress of an accident or a trauma), can also produce startlingly similar chemicals which also produce any or all of the above experiences typically associated with an NDE.
As to why people experience the 'tunnel' - that's due to the visual cortex where the information from the retina is processed. Hallucinogenic drugs and a lack of oxygen to the brain (as often happens near death) can interfere with the normal rate of firing by nerve cells in this area. When this happens, “stripes” of neuronal activity move across the visual cortex which is interpreted by the bran as concentric rings or spirals. These are more often than not, perceived as a tunnel.