He's two and a half, right?
He is not going to know or remember who gave him what candy, and it's way too much hassle and snowflakey to be telling every neighbor that hands out Reese's cups that he can't have them. It's not like they'd be able to run to the store right then and buy something he *can* have, and they'd probably just feel bad for not having something on hand that he isn't allergic to, so the less fuss made, the better.
Besides, even if a candy does not have peanuts in it, it may have been made in a factory that also processes peanuts, so you might still have to scrap the Hershey's bars, etc if there's a chance they won't be safe for him, either.
Just accept what the neighbors hand out, say thank you, and move on. When you get home, go through the loot, pick out the stuff he can't have, and if you're afraid he is going to notice the difference between what he can and can't have, have some of his favorite candy/cookies/treats on hand to "trade."
The chance of him encountering foods he can't eat is always going to be there, so you could consider this part of the learning/teaching process of having a child with a severe allergy.