In small tanks, it's Betta only.
Hobby Bettas are deformed. Their needs don't relate to the wild fish they were bred out of. I've kept wild caught Betta splendens, and they were so different from the multicoloured, large, over-finned things sold in stores that I don't think the lessons of nature apply. The natural habitat of long finned Bettas is a jar.
For once, we have to ignore their habitat. If we choose to keep fish that are as genetically manipulated and twisted as hobby bettas, we have to adjust to them. You don't treat a pug or French bulldog the same way as you do a husky. You adjust to its health problems and handicaps to make it have as good a life as it can. Domestic bettas need extra attention.
You can't do that in a 2 gallon tank. The small water volume gives you no reaction time if things go west. You need to be able to work with the fish in a reasonably stable water body. If you are very well organized and attentive, a 5 is reasonable. For most of us, as busy people who sometimes have less time, a 10 is a better choice.
We choose the fish because it has long showy fins, but those fins create drag and make swimming difficult. They exhaust the fish, which was raised in a jar and lacks muscle tone when it arrives in our homes. Maybe we like deformed scales, which affect streamlining. The fancier the betta, the more of a biological wreck it is. The larger the tank, the easier it is to maintain and keep as a habitat where the fish can live for years. It's easier to keep the temperature stable, to get in to make water changes (long finned bettas, with so many folds in their fins, are vulnerable to parasites and fungus in dirty water). It's easier to have different zones - calm, moving water, that allow the fish to exercise.
I know this is a different approach than you usually hear. My accent is on having a tank it's easy for you to maintain. If you can do the work, the betta can do fine.