Well, you have to define the rules (on the paper), then try to figure out how to transform them into events. Yes, you can use Random(), you can control it too if you use dungeon building rules (i.e. room sizes, overlapping etc.).
Look at other dungeon generating algorithms for examples.