This clears a lot of things for me. Thank you, Hildy1.I would usually understand "a goody" to mean something pleasant to eat, rather than a toy.
As dadane says, a treat could be something to eat, or it could be some other pleasant thing such as a trip, or an outing to a place of amusement.
trick or treat
1. go trick or treating - if children go trick or treating, they dress in costumes and go from house to house on Halloween saying 'trick or treat' in order to get sweets
2 the words that children say when they go trick or treating, to say that they will play a trick on someone if they are not given a treat (=sweet)