It's a bit complicated because the domestic molly is a hybrid. There are a lot of different species of molly, some of them are brackish water fish that will not survive in freshwater (like most of the true sailfin species) and some of them are perfectly comfortable in hard alkaline water (some actually dislike salt.)
The hybrid domestic molly can be kept in freshwater provided the water is hard, and kept warm. However, most tropical fish (dwarf cichlids, tetras, rasboras, gouramis, barbs, most catfishes...) are softwater fish. So we try to discourage people from keeping mollies in communities with such fish because they are basically incompatible in terms of water chemistry. Mollies in hard, warm freshwater is certainly possible (they thrive in it!) but in soft freshwater you probably won't have much success, as backtotropical said you end up with a very disease prone fish that seems to get everything it's ever exposed to (a long succession of ich, finrot, columnaris, fungus and whatever else pops up.)
So if your tank is medium to hard water, try it! You'll probably have some happy, healthy mollies. If it's a softwater tank, better not.