I fed my Betta freeze dried blood worms as a treat a few days a week. He really seemed to like them, but he would always get bloated come Saturday (As he got bloodworms on Thursday and friday) So his saturday food was usually a frozen pea that I had boiled and cut into small pieces and he got no food on sunday.
Not the best way to diversify a diet, but when all you have around to get fish food from is a walmart, sometimes compromises have to be made
I've fed peas to several generations of fish over the years - usually that's all I feed my tanks on Saturdays! I've never had a fish suffer adversely from it, even shrimp and snails seem to enjoy them.
But I only use FROZEN peas or ones that I've grown myself. This is because frozen peas are blanched, meaning boiled and then frozen quickly. No preservatives are added. Whereas with canned peas preservatives are added and with market fresh peas they can have pesticides and other things on them (I'm not sure about veggies, but I know most fruit in Canada and the US is picked green, then sprayed with a gas that makes them mature very rapidly on the way to market.)
(Edit)
I believe pea's are high in fibre so act like a laxative for the fish. and help get their system cleaned out.(And pumpkin works for dogs
) Another way to help a fish recover from bloating is to fast them (So not feed them for a few days) As this way the fish only has to clear out what is already built up and you aren't add more to its problem.