I think people are sometimes confused by the term "pedophile". A vast majority of individuals who are incarcerated for sexual crimes with child victims are not pedophiles. True pedophiles are not as common as people think, but those who fit the diagnostic criteria for pedophilia are indeed very difficult to rehabilitate. We explain the concept to people with the analogy, "If you are a heterosexual, what do you think the chances are I could change your orientation to homosexual?" Pedophilia is the same - it is a deeply entrenched sexual preference, and very difficult to modify. We can't cure the pedophilia, but some people with that diagnosis can, with help - and often chemical castration, modify their behavior and learn to control their impulses to act out. Just like a man who is highly sexually attracted to a woman can control an impulse to sexually attack her, a person who is sexually attracted to a child can control his impulse to sexually attack a child. The pedophilia itself is nearly impossible to change.
Most incarcerated sex offenders I worked with had sexually molested children for a variety of reasons, but the majority of them did not meet diagnostic criteria for pedophilia. Those who did meet criteria were a whole different breed and I was never happy when they were released.
I know everyone is afraid of pedophiles, but I can't say this enough (even though people hate to hear it) children should be warned against strangers sure, but if a child is molested it will overwhelmingly be a relative, friend, neighbor, babysitter, coach, teacher, pastor, sibling or mentor who does it. Not a stranger on the street.