Dana's right: Young kids cannot yet connect their actions with possible consequences such as "someone bad might take me." Your daughter, at 2, just is not developmentally able to do that, and won't be able to for a while yet. She might say to you, "OK, mommy, no cars," when you tell her not to get into cars -- but kids this age will say anything to please their favorite adult. That doesn't mean she truly connects her action -- which hasn't happened yet -- with the possible consequence -- which hasn't happened yet, and which she can't understand because no adult has ever harmed her.
So for this age, the only real solution is a lot of very vigilant supervision, coupled with consistent but not scary repetition of: "We never ever get into a car without mommy or daddy holding our hand while we get in!" and so on. Trying to do much "stranger danger" with this age could result in her becoming so scared she goes in the opposite direction and is terrified of everyone, and you don't want that either. Emphasize a lot that "we don't do X without mommy or daddy."
When she is a little older there are videos called "The Safe Side" that do a good job of teaching kids stranger danger --though the approach is much better than mere "all strangers are bad!" which is simply not true. These videos talk about "green light, yellow light and red light" people the child encounters -- with green light being adults they always know are always safe to go with, down to red light people being ones they don't know at all. It's a good series. Look at it yourself now (many libraries carry it) and get some ideas for a sensible, non-frightening approach to start teaching this. But remember that for quite some time to come, she is going ot naturally be outgoing and curious -- and those are not things to quash in a small child. Be sure you have age-appropriate expectations for what she can and can't absorb about this topic, and most of all be super vigilant because you have such a social kid.