Miller's rule is an empirical relation between the nonlinear and linear optical coefficients that applies to a large class of materials but has only been rigorously derived for the classical Lorentz model with a weak anharmonic perturbation. In this work, we extend the proof and present a detailed derivation of Miller's rule for an equivalent quantum-mechanical anharmonic oscillator. For this purpose, the classical concept of velocity-dependent damping inherent to the Lorentz model is replaced by an adiabatic switch-on of the external electric field, which allows a unified treatment of the classical and quantum-mechanical systems using identical potentials and fields. Although the dynamics of the resulting charge oscillations, and hence the induced polarizations, deviate due to the finite zero-point motion in the quantum-mechanical framework, we find that Miller's rule is nevertheless identical in both cases up to terms of first order in the anharmonicity. With a view to practical applications, especially in the context of ab initio calculations for the optical response where adiabatically switched-on fields are widely assumed, we demonstrate that a correct treatment of finite broadening parameters is essential to avoid spurious errors that may falsely suggest a violation of Miller's rule, and we illustrate this point by means of a numerical example.