I've never done it, but as long as you rinse the tub thoroughly beforehand, you should be fine. If you're worries, you can always wipe it down in advance with whatever you use to clean their tank.
The main issue is getting the water at a safe temp. What feels warm or hot to us will feel scalding to a Corn. Aim for no higher than 80 and you should be OK.
Make sure you keep a close eye on any potential escape routes - overflow outlets are a favourite target and an adult Corn can wriggle over the side of the tub surprisingly fast. Never underestimate the difficulty of trying to grab a fast-moving and slippery-wet snake!
Also bear in mind that whilst many Corns will be quite comfortable to wallow around in the tub for a while, some absolutely hate it and it stresses them badly. It's another one of those things which is an individual preference. It's not worth trying a second time with one which spends all its time thrashing around and fighting to get out.
However if you can get it to work, it's said to be good for building and maintaining muscle tone and can help in the event of constipation.