Industrializing a PIC micro-controller
I don't know why you're using such a ancient PIC in a new project, but there is no reason it shouldn't work.

Scaling 24 V signals down to 5 V is as easy as a resistor divider.  Something like this should work:



The resistors attenuate 24 V to about 5 V.  The zener guarantees the voltage into the PIC is within what it can handle because stuff happens.  The zener will also clip negative spikes, but to one diode drop, which is right about where the PIC starts misbehaving.

If you are really worried about negative spikes, then you can put a Shottky diode across the zener just to clip negative voltages.  Or you can break up R2 into two resistors that attenuate a bit after the zener, and use a bit higher voltage zener to compensate.

There are lots more things you can do.  It depends on how much you want to protect against.  More protection will add complexity and cost, but robustness to ever less likely abuse.  Only you can decide what the right tradeoff is.