Gonna get picky with word choice for a second. I was under the impression that elephants are tamed, not domesticated. Domestication happens when a wild animal is bred for generations by humans to have specific traits not found in the wild ancestor. I don't think that we've changed elephants genetics that much in the course of taming and training them to do things. Not saying it couldn't be done, although I've read that we've domesticated every domesticable candidate already. But, back to the topic you really want to talk about...
Yes, elephants (and oxen also come to mind for places elephants wouldn't like to live) are very strong animals that could be used for earth moving. But.....they'll never come with an attached bucket or front loader.

It's the scooping and lifting huge amounts of dirt at a time that make those machines so powerfully destructive or constructive, in my opinion.