From Nookipedia, the Animal Crossing wiki
Redd's Cookie is a food item introduced in Animal Crossing: New Leaf for the Fireworks Show. During the show, which takes place every Sunday in August, Redd will set up a Cookie Stand and will sell Redd's Cookies to the player for 500 Bells. Once the cookie is eaten, the player will receive a ticket, which can be returned to Redd before midnight to receive a special prize. However, some tickets may be duds, which results in Redd giving the player a consolation prize of either a sparkler or Roman Candle.
List of prizes