in principle, NEVER let them in. However, depending on what kind of car you have and what kind of car they have and if it looks like they don't bother with auto insurance, adjust your behavior accordingly. cabbies are tough to box out, but i'm getting better all the time.
It also helps to have a solid understanding of your car's physical presence. if you are a good parallel parker, then you have this. i can afford to ride real close to jerkface without paying too close of attention that it distracts me from keeping him out b/c i have an accurate sense of how close he is to my passenger side.
In high school i once threw open my passenger door to someone driving up a shoulder. They stopped.