In a large saucepan, whisk together the sugar, cocoa powder, cornstarch, and salt until well combined.
Gradually pour the milk into the saucepan with the dry ingredients, making sure to whisk well until the mixture is fully combined.
Place the saucepan over medium heat and bring to a boil, stirring or whisking the mixture often (I suggest using a rubber spatula to scrape around the bottom and sides of the pan occasionally). Allow to boil for one minute, the mixture should be thicker and coat the back of a spoon or rubber spatula at this point.
Remove from the heat and stir in the butter, one tablespoon at a time, then stir in the vanilla extract.
Strain the mixture through a fine-mesh strainer into a heat-proof bowl. Place a layer of plastic wrap directly on the surface of the custard and refrigerate until chilled, about 2 to 3 hours.
Once the mixture is set and no longer warm, whisk until smooth. Set aside.
Add the heavy whipping cream and powdered sugar to a separate clean mixing bowl. Using a handheld mixer or stand mixer fitted with the whisk attachment, mix on low to medium speed for 30 seconds to 1 minute, then increase the speed to medium-high and continue mixing until stiff peaks form.
Gently fold half of the whipped cream into the chocolate pudding until just combined, then fold in the remaining whipped cream until fully combined.
Add the Oreos to a food processor or blender and process until you have small crumbs.
Scoop about ⅓ cup of the chocolate pudding mixture into the bottom of eight 9 to 10 ounce cups. Use a spoon to smooth it out into one even layer. Spoon 1 and ½ tablespoons of crushed Oreos crumbs on top of the pudding layer in each cup and spread them out evenly. Evenly distribute the remaining pudding mixture between each cup (a little over ⅓ cup per cup) and smooth it out. Top each cup with the remaining Oreo crumbs, about 1 and ½ more tablespoons per cup.
Place all of the dirt cups onto a baking sheet and transfer to the fridge to chill for at least 2 to 3 hours.
Place two to three gummy worms on top of each cup right before serving.
Video
Notes
Storage Instructions: Leftover dirt cups may be covered tightly and refrigerated for up to 4 days.