I use both, for different industrial automation tasks, and don't see one as a replacement for the other.
The Pi has a lot of processing power, and lets you easily do complicated logic in your programming environment of choice... but interfacing with 24 V digital I/O, or even serial devices, will require external circuits or adapters for level shifting. I would also expect (just my opinion here) the GPIO pins to be more fragile, and less tolerant of voltage spikes, than digital inputs on a PLC.
Conversely, a PLC makes interfacing with external I/O easy, but has much less processing power and is less flexible to program (ladder language and I don't get along very well).
Different devices for different tasks, I say.
And in response to the protocols question... as long as you have the appropriate converters to get from the Pi to whatever physical layer you're using (be that RS-232, RS-485, Ethernet, ....) it's definitely possible to write a program that bridges between two connections using different protocols. Just a question of how much time you want to spend, and how much use you want to make of available libraries versus starting from the protocol document and rolling your own code.