Generally, put two males in the one tank and they will fight and one will likely be killed. Both fish will receive injuries.
The male Betta was named the Siamese Fighting Fish for a reason and it wasn't because they practised macramé.
The male Betta will also respond to any other fish that resembles another male Betta, no matter how thin the resemblance. It could be fins, the colour, the size or even the way another fish moves in a particular moment.
Now consider the female of the species, who has to be robust enough to survive any encounter with a male. She's unlikely to be a jessy pastry! Whilst one female Betta isn't going to switch on to Kill-Maim-Disfigure mode, at the sight of another female, she will possess that certain degree of robustness and may, just may, get bolshy with another female...or she may not.
From this, it has been acknowledged that it is relatively safe to keep a group of female Betta together, especially when compared, say, to a group of males.
In reaction to other fish, whilst the female is unlikely to destroy another fish that may somehow resemble an 'interested' male Betta, there is still that potential that she has, deep within her psyche, to unleash at a moments notice.
Contrary to many reports and opinions, you can keep other fish, either with a single male, or even a small group of females. Note, however, that much advice will advise against this, because there is a risk of conflict and aggression and do you really want to run that risk in your tank?
There's also the oft-forgotten aspect that some fish can actually be harmful to the poor Betta...especially those that will nibble at the Betta fins.
That said, here's a list of potential tank mates.
Bristlenose plec.
Cardinal Tetra
Corydoras catfish.
Ember Tetra
Harlequin Rasbora
Kuhli Loach
Neon Tetra
Otocinclus
Rummynose Tetra
Snails
NOTE that the tetra must be in a group. If there are only a few, then those individuals can be singled out and harassed by the Betta.
NOTE For obvious reasons, (hopefully), avoid fish that are the same colour as the Betta.
NOTE that the tank has to be at least 5 gallons. At least.
NOTE that if your tank is well planted, then you break up the line of sight between fish and so reduce the chances of any aggression.
NOTE also that some will tell true tales of how their Betta killed their Neon Tetra. As I implied previously, there is nearly always the potential for a Betta to attack another fish.