Yep they will use their hide as a toiletting area which is why most of us recommend a very easy to clean, easy to disinfect, non-porous type of hide.

Funny story about that actually. One of our adult female ball pythons by the name of Kyna, back when she was just a little worm, would always poop in one of her hides. You always knew exactly when she'd done it as she'd suddenly come literally flying out of her now soiled hide and jet over to the clean one. It was pretty hilarious! We never saw her move that fast unless she'd stunk up her snoozing area and needed to relocate fast.