Certain OCD sexual-related impulses are a real, recognised disorder, but there are specific conditions.
The sufferer has intrusive thoughts that they'll look up CP, or grope a passing woman, or force a kid into the bushes, or even just have a same-sex attraction. Note that they do not enjoy these thoughts, it's more "obsessive fear of uncontrollably crossing a moral hygiene boundary". It's not even that they actually have the impulses for real, or that they are even in a living situation where it is possible to happen, it's more of a meta-cognition obsession that they could somehow without warning.
(There are similar OCD conditions with violence too, people will get convinced that they could stab a loved one at any time, or they could become a serial killer, etc.)
People with these conditions can be helped by talking through the process with a therapist to break the obsessive mental loop, but the untreated form can degenerate into behaviours like the "POCD" list shown there. Continuous worry about actually performing [ACT] leads to extreme avoidance behaviours. Alternatively, it may lead to dangerous "testing" by the sufferer as to how much it's in their head, which in the case of CP-viewing meta-obsession may result in them actually downloading CP to "test" themselves as to whether they're real pedos.
However, although moral hygiene OCD is real, it also provides cover for people who just actually like doing the foul thing. The statement "I'm irationally afraid of suddenly doing [ACT]" can be cover for someone actually just wanting to do [ACT].