In theory you can keep the most commonly traded BBGs in freshwater, including soft water. But most aquarists find that most specimens are easier to keep in slightly brackish water. Even SG 1.002 will make all the difference, and at that low salinity, you can keep any hard water-tolerant plant as well as a very wide variety of fish. (To be honest, BBGs are so much easier to keep on their own that adding tankmates is something to do only once they're settled down and feeding, and even then, with extreme caution.)
Do also bear in mind that most people fail to keep BBGs successfully not because of salinity issues but because of feeding: their gobies simply starve to death. Feeding them is very tricky, and while they will eat almost any small live, fresh, or wet-frozen food, they feed very slowly, so easily miss out. Forget about keeping them with ANY bottom feeders except, possibly, other small gobies like rhinohorn gobies. Likewise, there's no point keeping them with fish that will snap up sinking food before it hits the ground, so mollies for example would be a bad choice of tankmate.
BBGs vary in their social behaviour. Some of the "dwarf" species are social, notably Brachygobius aggregatus, traded as the "Schooling BBG". But the standard species sold as BBGs are all territorial, and you want to allow each specimen its own cave or shell. They aren't big fish, but you'd be surprised how aggressive they can be, a single male happily claiming a patch 20-30 cm across if given the chance.
Cheers, Neale