People with OCD experience obsessions and compulsions, whereas people with OCPD do not, unless they also have OCD.
People with OCD and OCPD can share traits, such as hoarding items, perfectionism, and scrupulous thoughts. However, OCPD is about a pattern of interaction with everyone and everything in the person’s environment, whereas OCD is more related to specific fears or behaviors.
Although we often hear people jokingly telling their friends or loved ones that they have OCD, what is more likely is that they have traits of OCPD. If there is an identified, absolute result that a person holds firm to, but there are no obsessions related to it, and the person could perform any of several behaviors to get to that result, then the behavior is more likely related to OCPD than OCD.
For example, a person with OCD may fear having a thought about wanting premarital sex. They may think that having that thought will make them more likely to perform the act and therefore anger God. Individuals with OCPD may just think that it is wrong, period, they have no fear of the thought or any inkling that having the thought will make them do it.
Instead, they are likely to believe that anyone who does it is morally wrong, whereas people with OCD will generally judge only themselves and not anyone else. Some underlying traits of OCPD may be more common than people think.