MIDI is definitely capable -- code 64 is used for sustain pedal, and code 67 for soft pedal. And it's associated with a byte value for how far the pedal is depressed.
The third (middle) pedal in pianos is nonstandard -- i.e. used for different effects on different pianos, whether sostenuto or bass damper or practice mute.
In actual performance the only time it's ever really used (and rarely at that) is as sostenuto, since that's what it does on grand pianos like Steinways, but its effect is indistinguishable from simply holding notes for longer durations, so MIDI can simply represent its effect that way. (Unlike the sustain pedal which increases resonances in a big way and needs to be represented independently, or soft pedal which changes timbre as well as volume.)