The term Trick or Treat is also an American import but the general concept was already current. In my childhood, which was a regrettable number of decades ago, we used to get dressed up as witches or ghosts and go round our neighbours to show ourselves off, and they would usually give us small amounts of money - possibly sweets as well but I mostly remember money. This custom tended to blur into Penny for the Guy, which is the tradition of taking a 'guy', a stuffed model human figure in a pram or wheelbarrow, around from door to door on 5th November in memory of the Guy Fawkes plot and being given money to spend on buying fireworks. Penny for the Guy lingered on into the 1980s but has now almost completely died out as Trick or Treat has become universal. And also children aren't allowed to buy fireworks any more, which is probably for the best.
There is a very famous book by the folklorist couple Iona and Peter Opie called The Lore and Language of Schoolchildren, documenting childhood customs in Britain in the 1950s. They reported that October 31st was a major festival for children in some parts of the country, as big as Christmas. It was associated with licensed disorder and in some places was in fact known as Mischief Night. Children felt entitled to play all kinds of tricks on their adult neighbours with complete impunity for this one night. A favourite was removing garden gates and hiding them in outbuildings or throwing them in a handy pond. I feel that if this custom were revived we would hear a lot in the media about the failure of modern parenting. The present Americanised practice of Trick or Treating is a form of Mischief Night, exported to the United States by emigrants from the British Isles, sanitised over time, then re-exported back to us by Hollywood.