You can use sugar for preservation.
Candied fruit uses sugar to lower the water activity and bind the sugar molecules in a way that microbial activity stops.
But the important thing is that sugar isn't the same as salt. We can enjoy much higher concentrations of sugar in our food than salt. A typical soda is 10% sugar, while something like salt water from the ocean is about 3.5%, and would cause dehydration and serious organ damage in substantial quantities.
Salt also is quite limited in solubility in water, capping out at 28% by weight of a water solution, whereas sugar can easily be 67% or more (literally with more sugar than water) at warm or hot temperatures.
You'll have to follow established recipes for sugar-based preservation, because a lot of the data on microbial growth has to be learned through experiments and observations, rather than having sophisticated models for inferring which combinations are safe.
Other preservatives besides salt and sugar include alcohol, acid, and smoke. And there are complex interactions between microbes so that sometimes acid comes up later in the process.