Kinda, Tequila is made from fermented cactus from a specific
part of Mexico called Tequila. As far as I know it was never common
practice to bottle tequila with a worm in the bottle. Mescal on the
other hand, is a liquor very similar to tequila also made from
fermented cactus. Originally when mescal was being made the people
would put a worm into the fermenting product to determine if it had
a high enough alcohol content yet. If the worm died it meant the
mescal was done, if it lived it meant that it needed to ferment
further. The dead worm would be left in the bottle and it was
tradition that the person who finished the bottle had to eat the
worm. Some modern mescal producers still put a worm in the
bottle.