Obsessive-Compulsive Disorder (OCD) is a human anxiety disorder where people suffer intensely from recurrent, unwanted thoughts or rituals which they feel they cannot control. The disturbing thoughts or images are called "obsessions", and the rituals performed to try to prevent or get rid of them are called "compulsions". Between 1 and 3% of the human population worldwide suffer from OCD, and a genetic predisposition (based on twin studies) is believed to play a strong role.
Because we can't know what dogs are thinking, veterinarians generally don't use the word "obsessive" when describing canine anxiety. But compulsive behaviors are sometimes seen, and if not treated tend to become more disruptive and serious. Canine Compulsive Disorder (CD) is the name given to repeated and excessive stress-reducing behaviors like licking or sucking on a part of the body, holding or chewing toys, tail chasing, spinning etc..
Human OCD has been linked to deficiencies of the neurotransmitter chemicals serotonin, dopamine, and glutamate. Medications which increase the brain presence of these neurotransmitters reduce OCD symptoms. Neuro-imaging of dogs with compulsive disorder has also found serotonin and dopamine imbalances.
The influence of canine genetics on compulsive disorders is not clear. A 2010 study on "flank sucking" in Doberman Pinschers did find a strong genetic relationship. Similarly, certain breeds are prone to specific compulsive behaviors, such as Bull Terriers and tail chasing / spinning. Small dog breeds are generally more predisposed to experiencing anxiety disorders like compulsive behaviors and separation anxiety - which again suggests a genetic involvement.
Environmental stresses are more easily connected to compulsive behaviors. Dogs that are removed from their mothers too early (before the age of 7 weeks) are more likely to have compulsive disorder. One theory is that compulsive disorders are a way of coping with environmental stress and anxiety.