You get little red worms in compost when composting that is a good sign they are helping to turn the waste products in your compost bin into compost.
I am puzzled by the description of them having legs. Might they be millipedes or centipedes, they both have lots of legs. Not sure why they would be in the compost though. Slow worms live in compost sometimes but they are much bigger than your description.
Most of the 'creatures' that take up residence in a compost bin are no problem ( apart from vermin) even slugs and snails - if they lay eggs there if the heap hots up enough it will destroy them.
Without more details I cannot identify your uninvited guests but I would guess that they are unlikely to harm the compost. Unless they are vine weevils and they look like creamy/white maggots with a brown head - they are not good news for gardeners as these larvae eat the roots of plants.