Can I use a simple resistor for ESD protection on an ESP32?
A SAR ADC will have 10pF Cin. With your 1MegOhm resistor, the TimeConstant will be 10 microSeconds. Each Tau of settling gives you 8+ dB (one NEPER) more accuracy. Allowing 10 Tau, or 100 microSeconds settling, should give you 80 dB accuracy, or 12 bits. Again, this assumes just ONE SAMPLE per conversion.

on the other hand ...

A delta-sigma or sigma-delta ADC, which does lots of sampling during each conversion, will have an equivalent InputCurrent and using Ohms Law we predict an error for the FullScale conversion. Use the math Rin = 1/(FC); this comes from Iin = FCV; given Rin = Vin/Iin, the Vs cancel, leaving 1/FC.

For 100,000 samples per second and 10pF, the 1/F*C = 1/(1e+5 * 1e-11) = 1/1e-6

or Rin of this delta-sigma ADC is 1MegOhm.

With your external 1MegOhm, you'll have a 50% error because of the "voltage division" action.