2.5 gallons can be ok for one Betta if you do 2-3 water changes. If you have a 5 gallon and one Betta, you only need to do 1 water change weekly. If you have 2, you'll need to do 2-3 changes a week. A lot of people successfully do 2 Betta in a 5 gallon tank. If you have more than that, you'll need to do more than that. Ammonia is not the only thing you need to worry about, you also need to worry about nitrates and nitrites and waste.
More than 2 inhabitants in a 5 gallon tank will produce a lot of waste and basically turn your tank into a watery toilet if you don't clean it often enough. You can do it, but I would recommend 5-6 water changes weekly with 3 of those being a good deep cleaning of the gravel and anywhere waste can get with a good quality gravel cleaner.