ESP32 ADC measurment with variable input voltage?

What level of accuracy is ok for your needs, what is ADC used for?
One tip, ESP32 internal ADC attenuator is very nonlinear, so if you want accuracy use 0dB attenuation in code settings (in this configuration, max input voltage is about 950mV, so you need to reconfigure external attenuator).