Sampling theorem tells us we can sample only a band-limited signal. This means, the signal should have a maximum frequency with respect to time.
If a signal has a maximum frequency with respect to amplitude, we can apply sampling theorem to the amplitude as well.
In the sampling theorem, it is not necessary for the x-axis to be time for it to be applied. It is just a mathematical theorem.
The original version of Sampling Theorem:
If a function $x(t)$ contains no frequencies higher than $B$ hertz, it is completely determined by uniform samples taken at a rate $f_s$, where $f_s >=2B$ seconds apart.
A standard signal in this case is considered a function of time. We can also consider time as a function of amplitude of a signal. $t(x) = sin(x)$, where $x = sin^{-1}(t)$. If $sin(x)$ has a maximum frequency $B$, there won't be any quantization error if quantization is done uniformly spaced at intervals of $1/2B$ or lesser.
As user AlexTP says in their comment:
In quantization, the mapping from time to amplitude is injective and, therefore, a function; whereas the inverse mapping is not (one time can only have one amplitude). If you assume the inverse mapping to be also injective to make it a function, the mapping is bijective; so "amplitude" and "time" are interchangeable.
So the answer is if the relationship between time and amplitude of a signal is bijective, then we can have an analogous sampling theorem for quantization.