I was recently cruising my news feed when I chanced upon a quick advice column for fiction writers. The question was from a young writer who wanted to write a dungeon delving story and use the Dungeons and Dragons systems as a basis for the plot. The columnist answered that it was a terrible idea because dungeons, in Dungeons and Dragons games, are a series of self-contained, hermetically sealed chambers without any thought towards ecology. Now, that may have been true for first time dungeon masters who used random tables to generate their dungeons but that is the exception, not the rule.
Looking back at one of the classic examples of early dungeon design we can use B1: In Search of the Unknown as a prime example of why someone might think this to be true. This module was packed in with several editions of the basic set. It is primarily a dungeon delve consisting of a first level of worked stone with numerous chambers and corridors. The lower level is an unworked cavern system.
The new dungeon master is instructed to use the included tables to populate the dungeon with monsters and treasures for the players to encounter. The new dungeon master is instructed that only around a third of the rooms should have anything in them and that care should be taken when placing things. At no point does the module say to ignore common sense and place four ancient red dragons in a five foot deep closet! Yet, many people mistakenly believe that dungeon design in this era (and still today) should be random with no thought given towards the dungeon being alive.
Fast forward to the next release in the B line of modules and we see B2: Keep on the Borderlands. This adventure replaced B1 as the pack-in for the basic set. It included both wilderness and dungeon encounters as well as a keep for the adventurers to return to between forays into the wild lands. This became the module that a vast majority of Dungeons and Dragons players cut their teeth on in the early 80's. Published in December of 1979, this module has had the most reworkings of any module produced by TSR. Be it the Return to Keep on the Borderlands for Second Edition, Little Keep on the Borderlands for HackMaster, or the more recent hardbound version from Goodman Games. If any module is going to be a representation of dungeon delving in Dungeons and Dragons, this is the best one.
Since the original question involved dungeon delving we will ignore the existence of the keep and the wilderness encounters around it. The Caves of Chaos is a collection of various monsters lairs all grouped together in an expansive cave system located within a small canyon. The weaker monsters live near the bottom of the canyon with progressively tougher monsters living higher up in their own caves.
The humanoids that live in tribal conditions have their populations spread over multiple rooms, generally ending at the leader's room. This can be viewed as an early take on the 'boss monster' element of dungeon design. There are also a few solitary monsters inhabiting the cave system that live in smaller caverns.
There are a few areas where multiple dwellers share a cave system and the dungeon master is informed as to what the relationship is between them. In some cases they work together, in others there is animosity. Regardless of the nature of the relationship between neighboring monsters, additional text is devoted to what happens if losses are sustained or a tribe is wiped out.
For the most part, a weakened tribe will either flee the cave system in-between adventurer forays or reach out to their allies for aid or protection. Further, notes are provided for how the tribe reacts to intruders. Unless the adventurers are extremely fast and silent the noise of battle will quickly alert the rest of the tribe.
Have you ever made a loud noise in a small room or house? Sound travels, in a narrow cave system it echoes even further. Remember when that 'damn fool of a Took' knocked a barrel into a well? It wasn't long before the silent halls of Moria were filled with the sounds of Orcs coming to investigate.
Good dungeon design has always considered the ecology of the dungeon. Hermetically sealed rooms are a sign of an inexperienced dungeon master. Every dungeon is alive.
Some of this confusion may come more from video games rather than actual Dungeons and Dragons modules. It is video games where guards can find a body on the ground and go on alert for 15 seconds before returning to their programmed pathing. It also video games that have a problem with noise not alerting nearby enemies.
In closing. If you want to base your story on the Dungeons and Dragons system, go for it. The recent Honor Among Thieves movie is a great example of using the game to write something fun and enjoyable. Just don't use the 2000 Dungeons and Dragons movie as a basis. That was hot garbage.