Hello @amr
I used this example to verify that the PWM frequency can easily go higher than 20 kHz. Tested with an M5StackCPlus using GPIO26 and a PWM frequency of 100 kHz.
That said, I have no idea how this translates into ESPHome though, sorry.
Note: the three values pwm frequency, duty resolution and duty are dependent from each other. Check the documentation here.
Thanks
Felix