The correct answer is: B. an, a
The reason is that "onion" is an uncountable noun, while "tomato" is a countable noun. Uncountable nouns refer to things that cannot be counted individually, such as water, sand, or air. Countable nouns refer to things that can be counted individually, such as apples, cars, or people.
In the sentence "I need an onion and a tomato for salad," the word "onion" is used as an uncountable noun because it is not being counted individually. The word "tomato," on the other hand, is used as a countable noun because it is being counted individually.
If we were to change the sentence to "I need two onions and three tomatoes for salad," then both "onion" and "tomato" would be used as countable nouns.
I hope this explanation is helpful!