A hole isn't just a hollow space dug out of the ground or punched out of something. When you're talking casually with friends, you can also call a place that's small or dumpy a hole, like a rundown town or a really tiny apartment.
The word hole comes from the Old English hol meaning "cave" which in prehistoric times wasn't just a dark space to hide, it was a home. The word hole is used in many contexts from a rabbit hole where rabbits live to "a hole in one" — the golf term. And, if you're feeling sick or depressed, you can hole up in your room — hiding away from the world, watching TV for hours.