Which Pins Can Do PWM?
Almost all IO on an ESP32 can do PWM -- there are no specific IO reserved for this.
You are generally free to pick any free pins on the header of an Unexpected Maker board and setup PWM for it, but not all ESP32 chips have the same PWM implementation!
ESP32-PICO-D4
The original ESP32 has 16 PWM channels, grouped into 2 sets of 8, but each group of 8 channels only has 4 timers each, so IO in that group will share timers in pairs.
ESP32-S2 and ESP32-S3
The S2 and S3 range of ESP32 MCUs only have 8 PWM channels, grouped into 4 sets of timers, so the same rule applies that when using all channels, they will be paired with shared timers.
Shared Timer Limitation
In both sets of ESP32 implementation (16 channel and 8 channel), shared timers means it's possible to end up with 2 IO that you want different frequencies on, but they share the same timer, so they won't work as expected.
If you need a lot of PWM channels, all with specific timing, you might need to look at adding an external PWM controller to your project that has more channels or dedicated timers for each channel.
Resources
Random Nerd Tutorials has a great Arduino tutorial on using PWM on the original ESP32 which also works great on the S2 and S3, so long as you remember to stay within the 8 channel limit.
Updated on: August 5, 2023