That rule is more of a guideline. Certain fish, such as goldfish fall more into a 2 gallons per inch rule. They are very dirty fish and create a huge bioload. Whereas shrimp create almost none. I have heard of people having hundreds of cherry red shrimp in a 10 gallon. Loaches seem to not be very dirty fish, just as bettas aren't if they aren't overfed. Hence why stocking guidelines can be pushed a bit with good fish keeping practices and plenty of plants to help keep the water quality.
Please put as much of any plant that grows for you into your tank as you like! I personally love really heavily planted/overgrown tanks. I have a 10 gallon with a giant betta and some ghost shrimp and sometimes I can't find the giant it is so heavily planted! Let alone the shrimp. I couldn't tell you how many I had if I tried! Since loaches bury as well they might uproot your plants. Pretty much anything that is a bottom feeder will. Heck, some bettas like to uproot plants!
As for your dream tank, I know what you mean about wanting this or that! You might be able to squeeze some ghost shrimp in if you have say, 4 khulis and 1 betta, but you are going to have to be really careful with the water. Both shrimp and khulis are very sensitive to poor water. They also both really like to jump out of tanks. But a 30 gallon tank would probably be perfect for everything you want to live peacefully together. You could have 5-7 cory cats, 5 or so loaches, tons of shrimp, and a pretty betta to oversee everything. lol.
If you start to grow the plants before you add stuff they might stand a better chance against uprooting. Maybe. It depends on the fish. :)