I believe these animals can feel pain, they just don't respond to it the same way other animals would. If it bothers you there are a few things you can do... Feed smaller worms for example. Personally, I'm not botherd by it, don't get me wrong, I don't like it, but I realise this is something I have to do to feed my frogs. My cornuta won't eat locusts with legs, so I have to remove them for him.
Dubias are extremely hardy, I recently found a half dead one and tossed it in my bin, a week later when emptying my bin, I saw it was clenched to the top of the can, so I actually set him free.