I would say you are very, very limited with putting tankmates in the 1gallon or 2.5 gallon. Maybe a snail? But, I'm not the person to ask about snails since I know *nothing* about them.
For the five gallon, I think you would have some choices though. I have my betta housed with a school of tetras, a gourami, a group of cories, and a small pleco. But, that's in my 55 gallon tank and none of those would be good for a five gallon.
Basically, I would say try for a peaceful fish that does not have long fins (i.e. no male guppies) and stays small. I tend to stick to the 1" of fish per gallon as a rough rule, so if you figure the betta is taking up half of that, you can plan accordingly. The only thing I would strongly recommend is having a backup plan for the tankmate in case your betta takes a strong dislike to him/her. It seems that some betta are totally calm and peaceful like the guy have and that others don't want any other fish near them, whether they have long fins or not!
There have been a few topics on this exact question lately so you might try searching for betta and tankmate and see what you find! Good luck!!