It can be done, so long as you can filter it and keep it at proper temps. But just because something can be done, doesn’t mean it should be. Keeping a betta in a larger tank is so much more rewarding, plus you can have a much neater looking tank if it’s large enough to decorate. Happy fish, happy person.
Sure, you can keep the fish alive, but it’s like keeping a dog in your backyard on a chain all its life. It can be kept physically healthy, but it’s not going to be happy, and it’s not much fun to interact with.