Choose wisely, look through your selection of pallets and see if you can find a fairly decent plank in among them. I aim for about 5 inches wide and one inch thick with a minimum length of 24 inches. They're usually pine but you may drop lucky and have access to hard woods.
Prepare the timber, remove the nails and start sanding, I don't recommend using an electric planer unless you're really certain that you've got every piece of nail out of them. Even the dirt will dull blades and i advise against it. I'm a big belt sander user, start off with a 40 to remove the bulk of the rough and dirt and then move onto a 80 grit belt finishing off with a 120 sometimes or going to your pad sander so that you can also give the edges a rounding. How much you sand the timber is entirely down to you. I'm not a fan of the circular saw or band saw marks that are left after milling so i take these right out and down to the natural timber. You can take some of the sawdust and mix it with PVA glue to make a passable filler for the nail holes.
Find the center of the board and and draw a faint line horizontally along it. At each end and at about a 2 inches in drill a small pilot hole followed be a larger slightly recessed hole. These will be the holes for attaching the peg rail to the wall. For the coat pegs will require a bit of maths in determining the gaps between each peg depending on how wide you make your board and how many pegs your going to need. I usually put about 6 inches between my pegs.
Once you've got your holes marked its time to fit your pegs, i use wooden shaker pegs available from ebay. The shank is 10mm and that's what I use in the pillar drill, a pillar drill gives you accuracy and control that a hand held drill doesn't. Think about getting one cheap from the local buy sell groups. Drill your holes and give them a quick sand around the edge to remove any tearing if there is any. Put a smear of glue around the shank of the peg and push as far as you can into the hole, finish it off with a couple of taps from a wooden mallet.
You're basically done, just wait for it to dry. How you finish it is now down to you. Briwax is always a good choice, linseed oil, paint, there are many options available. My choice is Lichtenberg figure done with a microwave transformer.