Dungeons don't just encompass just underground caves and the like, but places like the wide open spaces of Floccesy Ranch or the barren Desert Resort. They include any areas in which Wild Pokemon are found, with the exception of Routes, which are given a section all to themselves.
Dungeons are typically quite dangerous places, but also have a lot to offer, from items, to money from trainer battles, to training from your Pokemon, to the ability to catch some quite often rare and wondrous Pokemon.
Often the Wild Pokemon, and sometimes even the trainers' Pokemon, will have some underlying theme, typically a type (like Ground-type in Desert Resort). This usually matches the aesthetic of the dungeon and serves to add a greater sense of immersion when playing the game.

