I have a little girl who is 25 months old, so pretty close in age who gets really frustrated with a couple of the boys who invade her space and walk right through her dolls and tea parties, etc. She pushes them out of frustration but I'm teaching her that it's unacceptable. First she helps the little boy up, hugs him and says sorry. Then she sits in the timeout chair and we have a little talk. It's working and she's learning to understand that I will never stop so she had better stop!
By the way, I only keep children that age in timeout for a minute or possibly less while we have our talk but I do it consistently.