crawl in a hole and pull it in after me
Solution 1:
The it refers to the hole itself. This is a bit of hyperbole, since it posits an action that is not literally possible. Crawling into a hole, so as to hide oneself, is possible, but to pull the hole in after oneself, in essence disappearing into the hole and then making the hole itself disappear, is not possible. This expression is fairly common as a way to indicate, as the OP suggests, a feeling of embarrassment.