Yes, but it cannot detect which specific device is connected to the jack and act accordingly.
A headphone socket can report whether there's a jack plugged in or not - that one bit of information is the total extent of traffic in the reverse direction. There is no electronic standard for back talk from analog audio devices, and it would be pointless for Apple to try, because no analog device currently on the market would comply with it.
That's how those stripe card readers work, sending "modem noise" into the phone: http://www.instructables.com/id/Read-any-magnetic-strip-card...