Prince of hell doesn't become an ally. In fact, he invades you 3 times (one of them is an unavoidable death if you try to move past him). Killing him in the cell prevents his invasions and gives you a special helmet.
It's not a dream, it's a world created by eldritch god like beings known as outer ones. If you are familiar with Cthulu mythos, you know what these are. G end isn't the ending anymore, just one of the many endings Grimm can reach before being looped back to the start. H end is where it all ends.
Basically, crawling one is pretending to be Alice so it can have Grimm endlessly chase after her because that's the form of love it likes best. Unfortunately for it, some of the other outer ones(Node, Mabel, and even its own splinter Prickett) like Grimm too much to see him be played with like this so they help him escape.