I guess you are talking about comedy situations in Movies
There's no special reason for cabbage. The throwing of vegetables might be related to old punishments, where a bad person had their head and hands trapped in a device, in a public place. People would throw things at them as a form of punishment.