The Mad Hatter was supposed to be The Hatter who was a hat maker who's been poisoned by mercury. That is why his hair was orange. In the sequel of the movie, he played and even larger part as the main protagonist.
He was the character representing the saying "mad as a hatter" which was ironic because in those days, due to the mercury they were expose to, hatters really did often go mad, or crazy, because they were poisoned. In reality, the character was based on a furniture dealer named Theophilus Carter who was actually deemed "The Mad Hatter" in real life.