I have 4 sons (all grown now) and a couple of them went through the same thing around the time they turned two. One used to love bubble baths but suddenly at that age he became afraid of bubbles and wind on his neck. Another developed a fear of the same dogs that he used to love playing with.
Fortunately for me, I had majored in Early Childhood Development while in college and taught nursery school, and observed this very same behavior in other children. It is a stage that many children go through sometime between the age of 18 months to 2-1/2 years. You may even notice that some children are more fearful of strangers and exhibit more than usual "separation anxiety". This is because they are at a stage when they are becoming more aware of the differences between themselves and other people, other things and their environment. It is almost as if a light was turned on in the dark and all of the creatures that have always been there, suddenly popped out! If he has no other serious neurological or other problem, you can probably rest assured that this phenomenon will go away just as quickly as it appeared. It did with mine and the other children whom I observed.
I wish I could offer more advise but it's been so very long ago for me. You may want to seek professional advise from your pediatrician but,in the meantime, remain calm and trust that, as his mom, you can probably be the best judge of what he needs in those anxious moments.
C. B-M