You guessed right: the constant current driver regulates its output voltage to keep average load current constant.
If you add a PWM on the LED at the output, and you reduce the PWM value to dim the LED, it will reduce average current, and the driver will respond by increasing voltage until average current returns to the set value.
From others who have tried it on this forum, the result is constant brightness no matter what the PWM value is in a rather wide range, then at low PWM values the driver hits its maximum output voltage. When that happens it may shut down or go to a powersave mode that will blink because it thinks the LED is disconnected.
In other words, it's not going to work at all.
Also you can't power the ESP32 from the driver's output because ESP32 draws variable current. So every time it does something with WiFi it will draw a spike of supply current, and with a constant current driver this means the LED current will decrease, causing dips in brightness.
You'd need a constant voltage supply, a buck converter to supply the ESP32, and a separate DC-DC driver for the LED.