You can use it with an expression pedal(I do). The M series are picky on what pedals you can use with them, so check compatibility before buying an expression pedal.
I use the very cheap Line 6 pedal, it works just fine for me.
You can't turn the pedal on and off though via the expression pedal, But you can use midi to turn the M5 On and Off.
I have a switch Dr(it sends midi), so patch 3 has M5 enabled without wah, patch 4 , same patch with wah on. I am sure you get the idea...