I wouldn't even put a Betta in a 3 gallon personally.
There is a huge difference between having healthy fish, and just keeping them alive. Yes, you can get a Betta alive in a 3 gallon. You might even be able to get them to live their full lifespan of 5+ years if you are very diligent about water changes.
But it won't be happy.
As an analogy, you can keep a human being alive in a closet for decades. Just provide food, clean the chamber pot, throw some antibiotics at them when sick. They'll live, but have an extremely poor quality of life.
Fish need room to swim around to be happy, and thus healthy.
So what to do with a 3 gallon? As others have said, inverts like shrimp and/or snails. No fish.