It can require some trickery and depending on what you're doing with the terrain, will need a decent level of math & physics knowledge, but you're certainly not the first to try something like this. Try and google for "destructive 2D terrain" or if you've been inspired by some game, you may also find articles explaining how they did it or how you can replicate a similar effect.