A refractometer can measure anything where you can draw a relationship - a first grade equation - between two variables.

Y = aX + k

If X is the only variable, and you have a law connecting all values of X to a value of Y, by measuring X you know Y.

We have this law for a water-sugar solution (each concentration will give a certain refractive index), for alcohol-water solution (same as above although here we have a Y = aX^2 + k, and we have two solutions), water-salt solution, and probably this could be repeated with any two liquid mescible things, e.g. water-glicerine, sugar-alcohol, or water-Johnny Walker red label, or water-Coke, or water-Limoncello.

If you know that your mixture is water-Coke, and you draw a table with the various RI corresponding to each coke percentage, by measuring the RI of a water-Coke mixture you can know how much Coke is in there.

The problem with beer is that we don't have any more a alcohol-water solution or a water-sugar solution or a sugar-alcohol solution, but we have a water-sugar-alcohol solution and we don't know how much of each.

We have a Y = aX + bZ + k equation. For each Y (RI) we have an infinite number of couplet solutions. A certain value of Y (a certain RI read by the instrument) can correspond to a solution with more alcohol and less sugar or less alcohol and more sugar for instance.

If we knew exactly a proportion, such as the sugar-alcohol proportion, then we could again draw a table. In the example above, if we have a certain known Limoncello, and we dilute it with water and for each dilution we measure the RI, then when we have a solution which we know is exactly that Limoncello with some water, the RI will give us the exact concentration of that Limoncello in the water.

Ultimately the only thing that the refractometer can tell us is the refractive index of a solution. The same refractometer can measure the saltiness of the water, the ABV of an alcohol-water mixture, or the sweetness of a sugar-water mixture, or anything for which we can write a table.

Incidentally, sometimes I read that a refractometer should always be used in °Brix and not in density points, because the relationship between °B and density points is not linear, or that, when a refractometer has both scales, only the °B is reliable.

True it is not linear, but that doesn't disturb the refractometer at all. For each RI there is a density value which is both a certain °B and a certain absolute density measure. Both scales are itched on your instrument in the right places. They are precise in the same way.