You seem to be referring to two different phenomena to me.
The first is where the brain creates an alternative reality while awake, and the second is where you see/hear something going on different to actual fact while in a coma.
This phenomenon is referred to as hallucinations. They can be auditory, visual, olfactory, gustatory or tactile. They can also be a combination of two or more of these types.
where someone sees, hears, smells, tastes or feels things that don't exist outside their mind.
They're common in people with schizophrenia, and are usually experienced as hearing voices.
Hallucinations can be frightening, but there's usually an identifiable cause. For example, they can occur as a result of:
Not all hallucinations are caused by major illness.
One example would be that gustatory hallucinations (where you taste something not there) can be caused by physical illness. The common cold, just like covid, has been known to make you lose your sense of taste but it can also change the taste of food.
Auditory hallucinations can be caused by tinnitus.
While in a coma
There have been anecdotal reports of people recovering from comas reporting of hearing people around them. The fact that although they don't respond, they may actually be able to hear, smell feel and taste, and that means that they may in actual fact build up a picture in their mind of what is going on while not being able to see it, and that picture may be different to actual fact. Either because what they are feeling/tasting/hearing is different to what they should, or they hear accurately, but because they cannot see it, they build up the wrong idea of how bad things are.
Science Focus suggests:
Patients in a coma appear unconscious. They do not respond to touch, sound or pain, and cannot be awakened. Their brains often show no signs of the normal sleep-wakefulness cycle, which means they are unlikely to be dreaming. Yet many people who have recovered from comas report dreams into which something of the outside world penetrated. Others recall nightmares that seemed to go on and on.
Whether they dream or not probably depends on the cause of the coma. If the visual cortex is badly damaged, visual dreams will be lost; if the auditory cortex is destroyed, then they will be unable to hear dreamed voices.