During programming (writing the HEX file contents into the PIC's non-volatile memory), the programmer supplies whatever clocking is needed for the programming logic in the PIC. During programming, data is transferred over a synchronous serial interface called the PGC (programming clock) and PGD (programming data) lines. The programmer will also need to control MCLR and in some cases Vdd.
If the PIC's oscillator were required for programming, then it would be impossible to program it in external oscillator mode without that oscillator running and hooked up. That would clearly be undesirable, and is not how it works.
For a brief introduction to this process, and some circuit design issues associated with it, see my In-Circuit Serial Programming intro. For detailed information, see the programming spec for your PIC.