Yes, OCD is genetic but having a parent or sibling with OCD doesn’t guarantee you’ll have it

Though researchers have not been able to locate a specific gene associated with OCD, there is evidence that OCD may run in families.