Can you outgrow ocd?

Not usually. Ocd is thought to be naturally waxing and waning.Many do experience lessening of symptoms with different life circumstances but probably not simply due to outgrowing it.
OCD. Individuals with successful treatment of OCD can learn very effective techniques to manage the symptoms of OCD and consequently not be imprisoned by it. Sometimes, people experience a reduction in symptoms as they get older.
Meds and therapy. Meds (usually antianxiety medications, but not always) combined with therapy with a clinician who specializes on OCD is the best combination to treat OCD, typically. OCD can eventually resolve itself, per your question, but the more severe the symptomology the less likely the OCD will spontaneously decrease or go away altogether.