Can we use ESP32 to program ESP32-CAM through ESP-IDF
All you need to program any ESP32 (Cam or not) is a serial interface.  How you make that serial interface is up to you.

Most ESP32 development boards have a USB to UART converter on them which you can use just like on an Arduino - keep the ESP32 you're using for the programming in RESET so it doesn't try and respond on the UART.

You could also program the "programmer" ESP32 as a UART passthrough to connect the USB UART through to the other UART so you don't need to mess with holding in RESET.