I was thinking of something similar (either terra cotta or a ceramic bowl) but for my bearded dragon instead as I'm struggling to find a hide big enough for her.
I would think it would be ok as long as any sharp edges are sanded down if you cut a doorway in it or you could lay it on its side but it would move about and might not be so comfortable for piggies to walk and lay on
I would recommend staying away from using clay pots for any animals. The fish keeping forum I belong to has had numerous members that lost fish since they got stuck in the hole in the bottom of the pot. You could still accept the pot and grow herbs for your piggy in it.