Is is a worm, parasite or something else?

Observation - Is is a worm, parasite or something else? - UK and Ireland. Description: Found this in the garden under dog poo. I want to make sure it's not a dog-related worm. Its only just over a centimetre in length.

Found this in the garden under dog poo. I want to make sure it's not a dog-related worm. Its only just over a centimetre in length.