ESP32 using acs712 give wrong values
The ESP32 runs with a supply voltage of 3.3V. That's also the reference voltage for analog inputs.

The ACS712 requires 5V as Vcc and outputs 0.5 x Vcc at 0 A (no current), i.e. 2.5V. For the ESP32, that's 2.5V / 3.3V x 4093 units = 2703. So your measurement is not that far off. 

Note however, the for higher currents the ACS712 will output a voltage of more than 3.3V. You won't be able to correctly read them as the ESP32 tops out.

To increase the accurracy, you probably need to improve several things:


Measure the ESP32 reference voltage and correct your readings accordingly (calibration)
Measure the ACS712 output voltage and correct your readings (calibration)
Add the capacitor as proposed by the ACS712 data sheet
Add the capacitor as proposed by the ESP32 data sheet
Improve the wiring to reduce noise
Use multi-sampling (i.e. use an average of several consecutive readings)


Update

The ESP-IDF programming guide contains a page about the Analog to Digital Converter with several ways to improve the accuracy. It will help to understand the overall architecture of the ESP32's ADC. And even though it's for the ESP-IDF environment, most of it should also work with the Arduino environment.