do some worms have legs
No. Worms do not have legs. They move themselves by multiple muscle contractions inside their body.