Yes, and no
So there is a slight problem with the interpretation, but the end result could be the same.
Per the description,
On a failed save, you create a phantasmal object, creature, or other visible phenomenon of your choice that is no larger than a 10-foot cube and that is perceivable only to the target for the duration.
So the image could not be of an “infinite” hallway, merely 10 ft of hallway. However, the image can adjust as needed…
While a target is affected by the spell, the target treats the phantasm as if it were real. The target rationalizes any illogical outcomes from interacting with the phantasm
So the image could be of a 10 ft hallway, with a fireball going off at one end. But as you race to the far end, walls and ceiling keep attaching themselves meaning that as you run the corridor builds around you with the fireball in pursuit. Think of how Magneto pulls in metal plates to form a walkway as he strides.
So the initial description of “infinite hallway” would fail/not be allowed; it is possible to describe the illusion that keeps up with a moving target.
An example given in the description is:
For example, a target attempting to walk across a phantasmal bridge that spans a chasm falls once it steps onto the bridge. If the target survives the fall, it still believes that the bridge exists and comes up with some other explanation for its fall – it was pushed, it slipped, or a strong wind might have knocked it off.
So the person under the spell fell, but even though they are presumably no longer inside the spell range, the illusion still holds true in their mind.