Earning hard hats in MLN takes a little exploring, but the process is simple once you know where to look. Start by heading to the Agents, Racers, or City Products page and playing the Robot Chronicles game, which is one of the ways hard hats become available.
Another route is through the garage. Jump into the towing game and complete its missions; sometimes finishing one rewards you with a hard hat. When that happens, keep an eye out for a box that pops up reading "collect MLN reward." Click it, and the hard hat is yours to add to your collection.