Each piece or 'slot' on the model it a separate mesh and texture, and each can be anything the model-maker wants. For example, neck pieces can be modeled and textured to be chainmail that hugs the neck, or a necklace, or a cape, or whatever. Changing the neck slot could even add kneepads or something if the model-maker was weird.
In the case of the hat in the robe slot, or even the wedding dress veil, it is simply a model added to that particular menu which happens to be shaped like a hat (or veil) instead of like a robe, and happens to be programmed to sit on top of the character's normal head slot.
That probably doesn't make any sense. I mean, it makes sense in my head, but it's after 1am and I'm tired, so it's probably not coming out straight. The point I'm slowly driving toward is that hats could be added if there were room in the module and if some industrious model-maker/texturer got cracking and made them from scratch. They couldn't be helmets, though, since helmets are hardcoded to replace the head instead of just sit on top of it.
To have your normal character's head and appear to put a hat on it and take it off again, you'd need two identical sets of clothing with the robe slot empty on one and with the hat on the other, so that you'd continually juggle the two sets of clothing to appear to be moving a hat around, which is more trouble than it's worth to most people, probably.
Gah, why don't I just go to bed?