Caution must be taken with all freshwater shrimp species if you are considering housing with fish. There are plenty of fish species that will live quite happily with shrimp. Please do your research however, as many fish, even community species, will view shrimp as food and attempt to eat them. As a general rule, do not house with larger fish that can fit a shrimp in its mouth.
There are many shrimp species that have little issue being housed with fish, even larger ones. The Cameroon Fan Shrimp for example, has an armoured carapace and grows to a nice sturdy 6" inches in size.
Smaller shrimp, such as cherry and amano shrimp, need a little more caution, as they are often mistaken for food - especially the fry. Do not house these with larger fish, or predatory species like Betta fish, or any fish that can fit them in their mouth. Species, like Angel Fish, are more than capable of hoovering up entire groups of shrimp in one sitting.
Photo credit(s): Canva Pro Licence / Estevan