Knowing how to share is an important skill for getting along with others, but parents shouldn't expect a child to really understand "sharing" until age four.
It's not surprising that it takes time to be able to share. There is a lot to learn. Children have to be able to control their impulse to grab something. They have to be able to see another child's point of view, understand time well enough to feel that it's okay to wait for what they want and be able to talk enough to sort out who gets what, and when.
Babies and toddlers just know that they want something, and they want it now. Toddlers first have to develop a sense of who they are, and then start to learn about ownership of things. Even though toddlers enjoy being near other children, and even want to do the same thing, they still want their own space and toys. It's all part of learning that they're individuals, and that they're important. Toddlers seem to have unique rules of ownership, such as, "I didn't want it until you had it" or "It's mine because I want it."
Three-year olds are at the next stage. They spend a fair amount of their playtime working out who will have what, who will do what and who can play. This is normal - it's how they practice the social skills needed for friendships.
By age four, children are better able to exchange both ideas and toys. They like to give and take.
If by age four your child still doesn't cooperate with others, and is hostile, it's best to get some help. If you are in Canada, and you wish to speak to a counsellor about this, contact Parent Help Line, 1-888-603-9100.