Start by reading through this
Then it's a design choice. If you want caves rather than constructed dungeons, look at https://code.google.com/p/jetblade/wiki/MapGeneration
If you want more classical dungeons, look at http://kuoi.com/\~kamikaze/GameDesign/art07_rogue_dungeon.php
However I have to say one of the things I hate about a lot of games these days is that the dungeons \ levels are designed by graphic artists.
They look nice, and have game play elements built into them, but are totally stupid.
Imagine you live in the middle ages and build a castle. There are certain things it needs to do.
1) Somewhere nice to live
2) Somewhere for the cooks and cleaners to live
3) Somewhere for the troops to live
8) Food and water storage
9) Weapon storage
11) Great hall
and the whole lot has to be connected in a simple way.
Troops have to be able to get from the barracks to defensive positions quickly, you want to get from your bedroom to the great hall down a private staircase. Cooks have to get from the kitchen to the great hall quickly and without the food getting rained on.
The same applies to dungeons, if you just generate random dungeons, it will be fine. I doubt anyone but me would complain, but you might want to think about going the extra mile and constructing some AI based dungeon designers when you have had a bit more expierience with random ones.