I have done this with my Kenwood portable MD player. Just run your headphone jack into the analog input for the MD recorder and record away. I don't think there is a way to use optical, and I have never heard of using an audio MD player/recorder to store data.
The tricky part is going the other way - now that macs don't have an analog input, you do have to get the iMic or some such device to record from an outside source.