Yes, infections can cause OCD. Research has shown that people who have obsessive thoughts due to an infection or parasites can also happen to be at risk for developing obsessive-compulsive disorder.