In order to just copy the video and audio bitstream, thus without quality loss:
ffmpeg -i filename.mkv -c:v copy -c:a copy output.avi
If you want FFmpeg to convert video and audio automatically:
ffmpeg -i filename.mkv output.avi
Source: video – How to convert an MKV to AVI with minimal loss – Super User