Both can be achieved with the right materials and some patience. Once you have decided which one you want to build, you'll then need to get your supplies. Most of these can be found at your local hardware store or even in your woodpile out back (if you have one).
If you decide to make a hanging hat rack, you'll need wood for the frame and hooks to hang the items on. What you decide to use for the hooks will be up to you. You can go the traditional route and get basic hooks from the store, or you may decide to use double hooks for more hanging space.
If you want to get creative, you can use the claws of hammers as the hooks or even horseshoes. Anything that has a curved edge that will keep things from falling to the floor and be able to support the weight can be used as hooks.
If you decide to create a free-standing hat rack, you'll need to gather wood for the base, the pole, and the pegs. Of course, you may decide not to place pegs on the pole and may opt instead to affix some other types of hooks. Those mentioned above can be used on this type of rack, and it may reduce the amount of work you have to put in to create this piece.
Some of the other supplies you'll need for this project include a measuring tape, saw (electric or hand), electric drill, wood glue, screws, sandpaper, wood paint (or stain), and a paintbrush.