As with any potential betta tankmate, the answer is a definite maybe. Betta can be great community fish under certain circumstances. The problem is you can never really know how your betta will get along with any other fish until they are put together.
However, mollies certainly would not be among my top choices for tankmates. Mollies are active fish that may provoke aggression in bettas. Varieties such as sailfins and lyretails may be similar enough to your betta in appearance that he mistakes them for another male betta. There is also the chance that a molly would pick on the betta and nip at his fins.
Of course, there is the possibility that they will get along fine, too. Some bettas are more aggressive, where others are more docile. I’ve had mollies that were the terrors of the tank, and others that were peaceful. You just never know.
I would consider other options, but if you do decide to keep your betta with mollies, or any fish as a tankmate, make sure you have a backup plan in case things go wrong. You’ll also want to make sure you have a large enough tank, ideally bigger than ten gallons.