The scale is personal freedom vs public safety. If the risk to public safety is low then it's a matter of personal freedom. If public safety is high, then that should be first. Like bike helmets, most places don't mandate them because the risk to others is low, even though the risk to the person is ridiculously high.
Halloween trick or treating has to have less risk than grocery shopping. You shop indoors with circulated air, anyone could have touched the packages you touched (like milk jug handles) two aisles over someone could have sneezed softly and you walk into the invisible droplets without knowing, then you contaminate your debit card by touching it with the same hands that grabbed cereal and milk, contaminate your steering wheel when you get in the car. Halloween is outdoors with breeze, smaller groups, you don't have to get all close to the product, and the candy can sit until the 2nd so germs die off.