Updated May 11
The keyword is “halophile”. Like other types of extremophiles, most of these are in the domain Archaea, which are kind of like bacteria, but kind of different.
The issue with salt water is that, a high concentration of sodium chloride in the surrounding water environment, might suck out the water that is inside the cell. That is called “osmosis”.
A way to avoid this is to have a compensating solute inside the cell, which does not have to be sodium, and can be a range of other things. Those substances keep the water inside the cell from being sucked out. It takes energy and certain genetic information to do this.
It isn’t exactly a matter of just “surviving”. They are adapted to their environment, and actually need it.
If you took them out of their normal high-salt water environment, and put them into distilled water (theoretically zero salt) they would die. A similar issue exists for hyperthermophiles, which would freeze to death at room temperature. These are some reasons why culturing and studying extremophiles is a major hassle.
As for viruses, they don’t “survive” anything, because they aren’t technically alive in the first place.
A virus may have a protein coat (capsid), which might be disrupted by a high-salt environment. However, as with bacteria, some species may be quite happy with it.
Some other viruses are “enveloped”, and are coated with part of the membrane of the host cell that they had infected and escaped from. Those are a lot more fragile, and may be deactivated just by sitting around exposed to the air for awhile (e.g. that cold/flu virus that sat on the elevator button for a couple of days). So I would expect those to be vulnerable to every threat, including high salt.
Fun Fact #1: “Salt” doesn’t just mean sodium chloride table salt. It really relates to ionic compounds, like a metal and a non-metal.
Fun Fact #2: The most abundant biological unit on Earth is bacteriophages. They are viruses that infect bacteria, and the oceans (salt-water) are full of them. I only really know a lot about one (1, n=1, a single, solitary one) virus, and it is one of these, and apparently quite durable in many environments.