It depends on the individual
Betta temperament varies. A calm fish may tolerate tank mates while another betta attacks anything that moves.
Tank size matters
Small tanks leave little room for territory or escape. Community attempts should use larger, well-planted aquariums.
Have a backup plan
Any tank mate attempt should include a way to separate fish quickly if aggression or stress appears.