There are kids who are as young as 2 years old who can already enjoy trick or treating. There are some who would wait for their child to turn around 4-5 years old so that the kids can already understand the concept of going door to door in order to get their candies and other sweets from the houses who would like to participate in providing the holiday spirit.
By the time that people reach the age of 12, some kids do not want to trick or treat anymore. There are some who think that it is cool that they can still do some trick or treating. It would depend on you when you would like your child to start trick or treating.