Generation of landscape and dungeons in the platformer

I need terrain generation for a platformer. I’m flying by ship to the left or right and I need mountains, buildings, etc. Can you tell me where can i see how it’s done?

And tell to me how dungeons are made? I understand that there will be a generated landscape, but how then to make underground tunnels after that… No idea