Yes, Hornworm bury itself in dirt then reemerge as moths. A hornworm is actually not a worm at all. Do you have Tomato hornworms or Tobacco hornnworms. You can tell by the color of the spike at end of tail. A tomato hornworm has a reddish spike and tobacco hornworm has a black spike.
Examine the ventral tip of the abdomen with a hand lens. Males exhibit 2 small bumps on segment 9, the next to last segment. Segment 9 is smooth on females, and there is a thin groove on segment 8.