Ok, so let me explain my answer a bit more...
When your output is +5v and you have connected -15V to the input, and let's say you have a 1k resistor between the pic and the input pin. The current will be:
V/R = (5-(-15))/1000 = 0.02 amps = 20mA going out of the PIC
Power dissipation = V^2/R = 20^2/1000 = 0.4W = 400mW This would be ok
The next problem is +15V -> With +5V on output, using Ohm's law again...
A = 0.01 = 10mA going into
the pic -> And the fact that the current is going into the pic is the problem...
Likewise, when 0V is being applied to the output, A=15mA going into the pic.
If you wanted a solution to this, you can use a fuse and crowbar circuit. This is a circuit that you see in industry all the time to protect devices from over voltage. You can search the web for some examples
, but the basic idea is using a SCR and a voltage divider circuit - When the voltage on the gate gets high enough, the SCR gets turned on. This leads to the input current rising - When the current gets high enough, a fuse is broken.
Basically, when the input voltage gets too high, it triggers a circuit to break an fuse.