Q. (See above question 1734) Does this apply to other foods and liquids besides fruits and vegetables, like tequila?
A. Shulchan Aruch (84) rules that what was mentioned in the last question in regards to fruits applies equally to worms that grow inside the water, meat, fish, cheese etc. However, each food or media has its own particular Halachos and details.
Tequila is a regional distilled beverage and type of alcoholic drink made from the blue agave plant. Contrary to popular belief, a common Tequila does not usually contain a worm. It only in the Tequila’s lower class similar, the Mezcal that worms were used. The larva is usually either a gusano rojo (“red worm”) or a chinicuil (“maguey worm”), the caterpillar of the comadia redtenbacheri moth. The red worm is typically considered tastier and according to some, was added for flavor the Mezcal. It may have been added as a proof to the alcohol content of the drink, as the worm was preserved.
In recent times, as a commercial curiosity incentive, some bottlers began adding a worm to their tequila too.
Obviously, since the worm, grew on the ground attached agave plant and was collected and placed on the alcoholic drink, it is prohibited to be consumed as any other crawling sheretz.
In regards to the worm prohibiting the Mezcal or Tequila drink even if there are sixty parts of drink to the volume of the worm and therefore annuling its effect, Horav Shlomo Miller’s Shlit’a opinion is that if it was placed for flavor purposes it prohibits the beverage.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a