U=RI, basically you are measuring a voltage drop across the resistor. And here you’ll know the R of the shunt. However, I’m unsure how good an ESP is at measuring differential voltages. Moreover, if it’s not isolated you’ll get at best-skewed results and at worse a short to ground.
The best way to do it would be with an op-amp https://www.arrow.com/en/research-and-events/articles/fundamentals-of-op-amp-circuits in a ‘Differential Amplifier’ setup with R2 and R1 set up according to what the max current you’ll be measuring and what the max voltage the esp32 car read.
So here’s a reply to each question
You can but you’ll have to use the op-amp. Or you can use voltage dividers to the ground on each side of the shunt to 2 adcs on the ESP32 which have to mesure exactly at the same time. Or the results will be incorrect. Go the op-amp route.