Dungeon is a special zone where you can climb lower and lower to fight waves of enemies, as well as gain two special resources - Alchemy Shards and Cinder Flowers.
Cinder Flowers are used to upgrade your Broom in order to access other areas on the map.
Alchemy Shards are used for various repairs and magic.
Dungeon first needs to be unlocked via the story.
Once it is unlocked - you can keep climbing further and fight increasingly harder waves of enemies for the resources, as well as some Coin.
There are two types of dungeon levels:
1) Basic levels that will give you 1 Alchemy Shard and other resources
2) Gold levels that will give you 3 Alchemy Shards and other resources
Every X hours you can also claim Idle loot from the dungeon which will make your overall progress much easier.