The smaller the rag worm the less harmful the bite and some species are harmless but if you're referring to the live type they sell in fishing stores or that you dig up from your beach at low tide then yes, this type does bite and many fishermen (or women) have received nips to the finger while trying to bait their lines.
The greenish ones have the meanest bite.