Why would you want to? MKV is awesome, and AVI is horrible. If you can't play them, use
CCCP.
If you really want to convert them, demux using mkvtoolnix and then encode the streams as avi using mencoder. Even that will lose you some quality, though, because again: avi sucks.