Unless you are talking botany, calling a tomato a fruit is falling for the fallacy of equivocation and too many people do this and have the pretension that they are being smart. The word "fruit" has multiple definitions, a tomato is a fruit by definition 1, but not a fruit by definition 2.
What most people understand by the word fruit is definition 2.
https://en.wikipedia.org/wiki/Onion