With a microscope objective both cover glass and tube length mismatching with the objective design can produce spherical aberration. Both are related with the objective NA.
I'm aware that at the times of monocular straight tube microscopes some models had regulable length tubes and they can be used to compensate the cover glass error.

Does anyone know the formula(s) to compute both errors compensation?

How could it be applied to infinite corrected objectives? (changing the tube lens focus distance, I guess...)

It could be useful in situations where we need to shot through a glass or when we want to use a glass cover corrected objective without cover._________________Pau

This formula doesn't use the NA for the calculations; I'm sure there is a more sophisticated formula for these calculations, this is just a rule of thumb.

Michel (and other authors) caution that this is not a good way of compensating cover glass thickness. The changes required are just too big for this to be of any practical value.

The reason for the extendable tubes was different: When using an eyepiece micrometer, you could match it to a stage micrometer with a convenient ratio by pulling the tube in or out. This saved efford at a time when calculations had to be made by hand.