The bright colors of the rainbow fish and the mollies, coupled by the mollies long fins resemble a male betta to another betta, causing them to be unusually agressive with species that share similar traits. They may not look like bettas to us, but to a male betta, it's like waving a red flag. Also, mollies and bettas compete for the same upper portions of the tank, and conflict will arrise there. It is not advisable to put a betta with that grouping of fish.
Of course, theres always weird cases. If you really wanted to, you could try it, but you very likely will end up with a dead Betta, dead mollies, or both
We recomend you dont try it though.
bettas also tend to get stressed in very large aquariums. most people find that their bettas are happy in something like a 5 gallon. 2.5-10 gallon is the preferred range of tank size for a betta.