According to CBC News (cited below): “While the act of going door-to-door in costume in exchange for something sweet to eat has been around since the Middle Ages, it wasn’t until sometime in the last century that people started saying ‘trick or treat.'” Apparently, the very first trick-or-treat took place in Alberta, Canada.
The first trick or treat
Nick Rogers, who teaches history at York University in Toronto and wrote Halloween: From Pagan Ritual to Party Night, the earliest use of the phase can be traced to a newspaper clipping from 1927. On November 3rd of that year, The Blackie Times of Blackie, Alberta, noted that:
Halloween gave an opportunity to the young to use up some of their surplus energy which was freely taken advantage of. Threshing outfits, wagons, old autos, barrels, etc., decorated the front streets and buildings were overturned, while front and back doors were invaded and inmates held up by the awful word “Trick or Treat” from the youthful invaders who carried…
Prior to this, historians believed the first use of the phrase occurred in 1947.
Trying to end Halloween fun
The holiday has long been associated with a bit of misbehavior, especially among older kids. Throughout the 20th century, North Americans have long tried to get ahold of Halloween hooliganism, even trying to replace the holiday with a more wholesome one.
CBC noted that “[i]n July 1950, the U.S. Senate recommended that Halloween be renamed ‘Youth Honor Day,’ and young adults and teenagers would pledge good behaviour on Halloween and try to tone down the holiday.”
It never really took off.
Rodgers explained that while Halloween is something wild today, going door to door at this time of year wasn’t always associate with tricks or treats.
“It goes right back to Hallow Mass to the original Christian holiday of honouring the dead,” Rodgers said. “Back then it was called ‘souling,’ where people would collect food from neighbours’ homes in exchange for praying for their dead relatives. ‘The idea being that, if you prayed hard enough, you would help them get to heaven.'” — WTF fun facts
Source: “Albertans may have been 1st to say ‘trick or treat'” — CBC News