If you measure your child's foot size correctly at home, there's no reason why you can't buy shoes online. However, remember that most retailers don't offer alternative width shoes as standard - you may have to pay extra, or even be limited to certain styles.
That's why it's best to go to a specialists shoe brand or retailer (even online).
However, if you're not confident in measuring your child's foot size correctly, it's best to go into store if you can. The staff are specially trained and will be able to help you get the exact shoe size your child needs.