Toddlers need to learn limits in a warm, loving way, and that hitting or taking toys is not something that we do. There are many ways to help toddlers learn this, without yelling or hitting or being harsh. Gently removing the child from the situation and explaining what is appropriate is a first step, if the toddler is old enough to understand. If not, try substitution and distraction.
Sharing is something that children learn, and often by our example.
For some children, removing the favorite toys before others come over can help. There are many good books on discipline without yelling or hitting that might help you to learn what is the best way to teach your child. In other words, they may be asking for a little more one on one attention. Try reducing your activities and spend some time alone reading, playing or talking. You may be surprised how quickly that fulfills their needs calms them down.