freshwater sharks arent really true sharks, dont let the name mislead you. My nicest fish are my bala sharks and my irridescent sharks (which are actually catfish)...BY FAR my hamless tetras are WAY bigger a**holes than my "sharks".
So, yes sharks can go in community tanks, as long as your tank is big enough. Some are more agressive than others....i e the black shark. Another thing to keep in mind is most sharks are more active and jumpy than most fish, so I may not put them with slower fish that may become more stressed by so much jumpin around. They also like a lot of room to swim, so if your tank is heavily planted/decorated make sure to leave room up front so they can swim back and forth unobstructed.
What kind of other fish do you have in the tank? Im sure a rainbow shark would do fine with things like tiger barbs or even tetras, i just wouldnt recomend slower more peaceful fish.