In dreams, the defence mechanisms we put in place to prevent ourselves from deeply feeling the impact of such things as relationships, love, anxiety or pain can often manifest as an enclosed space. Restraints and constraints can appear as actual walls and barriers.