Possible but tricky.
As the opto-isolator is a one way device you would have to use two, one for data to the MCU and one for data from the MCU. You would have to ensure the incoming one was in a 'non active' state when driving the outgoing one or they would simply fight each other. If you can be sure of that, use a weak pull-up to make the input default to high state and pull it low with the input opto. Drive the pin high to push more current through the LED of the outgoing one.
Brian.