The Sandworms of Dune are quite likely the inspiration for Dungeons & Dragon's 'Purple Worm'. At 15 Hit Dice, 40 feet in length, and able to swallow their prey whole the Purple Worm is one of the tougher monsters in the game... but they're only about 10% the size of the Sandworms of Arrakis.
So in order to keep things simple we'll use the Purple Worm as the base for our Sandworms but make them 10 times bigger.
They don't have the tail stinger of the regular D&D monster... but with a bite doing 20d12 damage they hardly need it. With 150 Hit Dice there's little they need to fear.
With a 100' (or more) wide mouth only exceptionally fast creatures would have any chance of escaping it's bite.
If this wasn't big enough, Paul Atreides summons a worm that's 9 times that size. I'm not sure there's much need to roll 2d12x90 for damage anymore.
Truthfully, this isn't a monster that can be battled in any conventional way. Although now that I think of it... D&D needs monsters like that. Things the players know that now matter how tough their characters are, they need to run away from. Things that no level of min-maxing and power gaming will make any difference against.
If we walk without rhythm, we won't attract the worm.