The rules for Squeezing on page 192 of the PHB state:
Squeezing into Smaller Spaces
A creature can squeeze through a space that is large enough for a creature one size smaller than it. Thus, a Large creature can squeeze through a passage that's only 5 feet wide.
Using these rules, can an Ogre squeeze through a corridor that is 5 feet wide and has one or both walls created by the Wall of Fire spell without entering the spells' area and taking damage?
For context, in the actual situation there was a straight brick wall, and a PC cast a straight-line Wall of Fire parallel to that wall, with the damaging heat emanating outside the formed corridor, leaving a 5ft wide safe gap for the PCs to fit through. The intent was to force the Large enemies to take fire damage, should they choose to approach the PCs through the corridor.