If a PIC has 'self-write' capability it can erase and re-program flash under program control - also in flash. You wouldn't want to do ALL of the flash..
Accidental erasures are not unheard of - but the ones I am familiar with are on older chips where transients on MCLR/ exceeded Vpp and initiated a bulk-erase. I don't think is easy to do it with newer chips using ICSP commands to control erase/program.
For the PIC series, read about Flash Program Memory in the datasheet. One such chip is the 16F1519. The part about flash memory is Chapter 11.
Source=PIC1519 datasheet
The Flash program memory is readable and writable during normal operation over the full VDD range.
Program memory is indirectly addressed using Special Function Registers (SFRs).
Some chips for secure applications have a special mechanisms to erase themselves. Some even store the critical parts in battery backed SRAM and cut the power when necessary.