I believe that the 1 inch of fish per gallon applies to some fish, but not all. Take clown loaches for example, they need at least a 6 foot tank in order to be comfortable and need to be in groups to be happy. There are some fish that can and have to be alone, like oscars. Oscars need at least a 55 gallon. Bettas are really controversial, they are solitary fish, but what size gallon tank, everyone has an opinion. I would say a 5 gallon tank would be ideal for a betta, even for some small fish that stay small.
this riddle lies in the water. The amount of fish or size of fish affect the bio load. the reason they 1 inch of fish for 1 gallon of water is that in general most ppl change the water once a month following the 1 to 1 ration generally allows for sufficient biological filtration. However with accurate testing and ample water changes I have seen success with all types of fish in all types of aquariums. just think of it like this is we put you in a 12 foot by 12 foot room for your entire life how happy are you going be. bigger is always better.
55g#2- 2 discus, 1 angle, and a clown loach
30g- Black ghost knife
20g long-electric blue crayfish
10g-mystery dwarf cichlid