I hate to be picky, but ... in what context?
In the game '20 Questions,' where the three categories for everything on earth are 'animal, vegetable, or mineral?', yes, definitely.
In a category like vegetarian or vegan dishes, yes, also; though a more recent popular term seems to be 'plant-based,' as in 'plant-based menus / diets.'
But in a category like 'fruits and vegetables' or 'fruit and vegetable servings,' it depends. Beans and peas, yes, definitely; edamame, probably. But lentils, chickpeas, maybe not so much, at least not in ordinary conversation.
Crops like alfalfa and soybeans, also no, generally not. (And we don't usually use 'pulses' in AE at all, in my experience as a layperson.)
Peanuts, definitely not, IMHO.
(But I have to say that if Wiki's list is right, there are a lot of legumes that I never even knew were legumes, including alfalfa and peanuts, and also clover, lupins, mesquite, carob, and tamarind! Who knew ...)https://en.wikipedia.org/wiki/Legume
Not sure if that helps. Maybe if you had a particular sentence or two ...