Why not encourage families to have a trick-or-treat hunt in their own houses or on their property instead of going door to door? Parents/guardians could hide well-wrapped or prepackaged candies or treats, and also gift-wrapped "tricks" like pieces of coal or plain rocks or even things like small potatoes. It would be smart to have a lot more treats than tricks, but maybe give a prize to the one who finds the most tricks.
In our family, my mother always hid our Easter baskets and we had to find them. I remember one year, she put mine in the dryer. This is the same kind of thing, a distraction that kids might enjoy, ending with something sweet, and no risk to them or others unless friends are invited.
If parents have enough time and energy, they could make some of the confections with the kids. Things like Rice Krispies Treats come to mind. Color them orange and wrap in waxed paper or Saran Wrap. Kids have to find them to eat them.
I hope today's children aren't too jaded to find things like this fun.