It’s a myth perpetuated by parents so they can continue to confiscate Halloween candy for themselves.
It is a myth propagated by those afraid of strangers.
Everyone winks about Santa Claus. People get angry and scared about the "threat" from adulterated (pun intended) Halloween candy.