1) Make sure the hats have a consistent anchor or mounting point. I'm not versed in 3D, but that would be the objects pivot. If that fits, skip step 2.
2) If you have no good pivots: Add Game Object, name it "Actual Hat". Give it a dot icon (inspector, top), so you see where it is. Take one good example hat mesh, and place it as a child. Now move it so that the point icon is where the hat is supposed to sit on the head. That's your anchor point. Later you do this for all hats, hence rename the "Actual Hat" to whatever the hat is, say "Cowboy Hat".
3) Next we define the place where the hats are mounted. Make a new game object, again, add a dot icon of a different colour, and call it "Mount Head". Next, drop one good example hat, say "Cowboy Hat" as child, and zero it properly. Now move the whole Mount-With-Hat contraption where it fits nicely. The pivot of the hat, the mount point and the place on the character model should now align. Because of this, you can now make any number of hats and when they are child and zero of the mount, they should fit perfectly.
4) Now, the drawing hats trick. Drop all hats under the mount (as prefab or as they are). This is now also the pool. In a more sophisticated system, the pool might be a separate object outside view, and you draw, parent, and set zero to mount.
5) All you need to do now is get a random hat, for example with get Random Child. I think there's also a method based on tags. Then activate this hat. Since you store the randomly drawn game object in a variable, you can use this to deactivate the object again, and then repeat with getting a new random object.