Dynamite can be used to blow holes in stones or mountains. The difference to manually hacking through the rocks is that the dynamite does not leave any rocks or ore pieces which can be picked up.
Except for destroying the own buildings which I don't want to keep any more: Is there any good use of dynamite in singleplayer mode? Or how can I use it so that I have any materials for picking up?