Bettas are not community fish. They can be aggressive to other fish and they are easily stressed by small fish darting around in their tanks. That said, it is possible.
A tank of 3+ gallons lets you add two or three small shrimp or snails.
A male betta in a tank of 5-6 gallons could be kept with:
3-4 pygmy corydoras
OR 3-4 harlequin rasboras
OR 2 dwarf platys
OR a small group of shrimp.
In 8-10 gallons you could have
Shrimp and/or snails
OR 5-6 pygmy corys
OR 3-4 panda, peppered or other smallish corys
OR 5-6 otocinclus (Experienced aquarist only - extremely hard to look after)
OR up to 8 harlequin rasboras
OR 5 or 6 small platys (or 3 or 4 big ones.)
Or you could combine some of these, like 3-4 pygmy corys and 3-4 harlequins.
Corys and harlequins are schooling, keep at least three or don't keep them at all.
There's a fairly long list of things that you can't keep with a male betta at all and they are:
All barbs (far too nippy)
The vast majority of tetras (far too nippy - might get away with embers)
Female bettas or other male bettas (will be attacked)
Gouramis (some people manage it but generally not a good idea, too closely related)
Plecos (only because they grow too large, they are fine in a really big tank, ditto loaches)
Guppies (will be attacked)
Mollies (incompatible water requirements)