because they are a worm
Silk is not made out of silk worms. Silk is made by silk worms which spin to make a cocoon for themselves.
They look like worm like you see in a dog
Silkworms produce silk when they grow from worms, into their adult stage: a moth. In between these stages, the silkworm spins a single thread of silk around itself, which eventually hardens into a...
Silk worms create silk. That's where silk comes from.