Once upon a time.....
During the samhain, Celtic people wear costumes, usually consisting of the head and skin of beasts. Irish immigrants who came to America in the 19th century decorated radish and potato tubers by carving the character "stingy Jack".
In the Middle Ages, people dressed as ghosts or evil creatures and performed under those costumes in exchange for food and water.
Nowadays.....
Children often dress up as monsters, zombies, or monstrosities. Pumpkin-shaped pumpkins are the symbol of this festival, and children will knock from house to house saying "trick of treat" and getting candy from the people attending the festival.