The origin of the festival is disputed, and there are both pagan and Christian practices that have evolved into what Halloween is like today.
The phrase trick-or-treat was first used in America in 1927, with the traditions brought over to America by immigrants. Guising gave way to threatening pranks in exchange for sweets.
Nicholas Rogers, a historian at York University says that when people prayed for the dead at Hallow Mass, they dressed up. When praying for fertile marriages, the boy choristers in the churches dressed up as virgins. So there was a certain degree of cross dressing in the actual ceremony of All Hallows Eve