Firstly buying a dog for a 2 year old comes like a very bad idea. Since a two-year doesn’t understands how to handle an animal (even with the guidance of elders) since its very natural of really small children of this age to unintentionally hurt the animal. I’m not sure what are your prior experience in pet keeping, But as a responsible pet keeper you have to understand that having a new dog at home would be like getting 2 more two year olds in your house which is a lot of responsibility. Its usually been seen that in such cases the owner of the dog soon decides to part out from the dog since it becomes too much of a responsibility to handle which in turn very badly affect a dog.
It would be my humble request to you for not going for a dog right away, rather let your child grow to the right age until you see a natural bonding in your child for animal.