i'm not sure...but i heard that if the other fish like..guppies? if they have long and colorful tails the bettas will get defensive/territorial...and will try to kill the guppy...so i don't recommened any colorful or long tailed fish.
I would not recommend guppies or tetras of any kind. The guppies, mollies, platies and such have tails that the bettas will think are tails of other bettas and they will fight them and injure them. Tetras on the other hand will nip the fins of the Bettas and since the Bettas do not see the Tetras as enemies they will allow them to do it. Soon you will have a betta with finrot and he could die of this. Also do not even think of Gouramis of any kind. Bettas belong to the Gourami family and they will kill each other literally. (usually the gourami will kill the betta)
The best of tankmates for bettas are Otocinclus catfish in small tanks (5 gallon) or Cories in larger tanks. They need to be bought in groups of 3 or more. They will also help keep an algae problem down.
I personally would not recommend bettas and Goldfish occupy the same tank as Bettas need warmer tanks and goldfish need cooler tanks.
inuyasha_girl10110- I would recommend you give your Betta the run of the whole top area of the tank. They really don't like other fish that swim consistently at their level. Give him lots of plants, planted and floating. it doesn't matter if they are live or artificial he will like them.
As for tankmates in a tank that size you could have Corys,Otos, bristlenose or any of the smaller loaches. The bristlenose would keep any algae taken care of and the loaches would take care of any snails, and the Corys are just cute .
I really think that is the secret of the success of the Otos. They are also small and very fast and they can hide places the betta cannot get into and get there faster than he can make it. I wish I had stayed with Otos in Emma's tank instead of trying the Cories. I may not have had the problem with her being the little bully she was.
You are very correct. You really do not know what you will have until you try as each and every betta is totally different. Where one may accept tank mates very well, the next one may well be vicious and not tolerate anything in the tank with him at all (or her as it turns out at my house). You are right that one should always have a back-up plan in case of emergency.