Create terrain at ingame using heightmap

hi ,i want to create a terrain based of some random height map at run time is there any ways to achive this.i know how i can import height map and use it but i want to create this in game.please help

and i would also like to know if there is any way to create a new map/level at play time so that user can create a random map for his game.

thanks