I just wanted to revisit this with new information.
Earlier, I had done a ramp test to 2.5 kV on a 1N4007 diode with a series 10 MΩ resistor. The diode had failed at a voltage about 2 kV and later measurements showed that the diode had permanently degraded. So my conclusion at that time was that, even with a series resistor, a high enough voltage causes the diode to fail.
But there is more to this story and that statement isn't correct. When looking at the datasheet of 1N4007, the worst case leakage current is specified to be 50 uA (at rated voltage and 100 degrees celsius temperature). This means that the manufacturer guarantees that the diode will NOT GET damaged under these conditions.
But when I made the ramp test, at 2 kV, with a 10 MΩ resistor, the resultant current is 200 uA, well beyond the 50 uA that the manufacturer specifies. If I had used a 40 MΩ resistor, the diode would not have failed at 2 kV.