ESP32 with external power supply and serial communication between ESP32 and PC
Yes it is the way it works as common ground.
Ref: https://www.allaboutcircuits.com/technical-articles/an-introduction-to-ground/