You may enjoy gaggles of kids knocking on your door in flashy costumes but it might seriously stress your furry companion.
Unless you are certain trick-or-treat is not an issue, that your pet is not alarmed by frequent doorbell rings, and that he won't escape or, worse yet, bite the Wolfman, you probably should find a comfortable and safe spot in another room for him. Include a toy to occupy the time and soothe anxiety.
Also, remember that chocolate can be fatal for a dog. Any candy containing xylitol (an artificial sweetener) can be fatal, too. Be safe, and don't give him any candy! Keep all candy out of Fido's reach until it has all been eaten or removed from your home.
After the beggars stop coming, take time to soothe your pet. They may feel somewhat traumatized.