The answer is no. OCD (obsessive compulsive disorder) can't be diagnosed in a two year old. Here are the facts: OCD symptoms start by age 15, and OCD is diagnosed at an average age of 23 (Rasmussen and Tsuang, 1984). So OCD symptoms show up in adolescence, and the OCD diagnosis comes about as a young adult.
Your child lining up his toys is developmentally normal. If you are still worried, please take your child to a pediatrician for a developmental assessment.