OP, just wanted you to know that your post described many, many arrivals home from the grocery store with my just-turned-two year old! LOL. My DD is *such* a drama queen...I hate to label her like that but really, she is.
She screams sometimes even when she's not angry, or cries on purpose because she's tired and she expresses it by deliberately crying. It's really funny, actually. She also does the freak-out-angry screaming, and man, it's like an air siren going off in my house! I just roll with it. Like other posters have said, it really isn't a habit or behavior issue so much as just immaturity. They don't know how to handle their emotions, so...they scream.
With my daughter, if I can't carry her or give her tomatoes or whatever, I just empathize calmly. Sometimes if she's not *too* upset, I can distract her by telling her to make different faces. Like today she cried as soon as we got home because it was naptime (we get home just in time for nap *every day,* but for some reason this also necessitates crying, basically as an announcement that she's tired), but I said, "can you smile? can you make a happy face?" and she did. I kept having her make different faces all the way into the house. Then she cried again.
Fifteen minutes later she was asleep.
But really, the best advice I have for you is to head it off with food and sleep.
If my DD is really losing it like you were describing, it's almost always because she's hungry or tired. Usually both. I always have a LOT of (healthy) snacks so I know I have something that she'll eat. When she starts to get the slightest bit whiney or difficult, I feed her.
And btw, OP, I think you handled the situation perfectly. You gave her tomatoes AFTER she had calmed down, which is a HUGE step for her. Being able to calm herself down like that is really, really difficult for a toddler--not something I think we can expect all the time--but I agree that we shouldn't give them what they're asking for WHILE they're screaming for it. But when she stopped herself--yeah. That's awesome. Also, you were consistent: you told her she could have a tomato after you put away the groceries, and that's what you did. That consistency of actions and words is really reassuring for a toddler.
(For example, when my DD is nursing sometimes she'll hit me, and I always tell her if she hits me again then I'll take the milk away. Without fail, she hits me again--this time with a grin on her face. She wants to see if my words and my actions will line up. I always put her down then, of course. And she's only upset about it for a second, usually. She needs to test the boundaries of words and reality. I need to find a better way for her to do that, but anyway...!)
Oh, and nursing is always a wonderful cure for tantrums! I don't know how I would parent my DD without being able to nurse to calm her down sometimes!