Handbrake is
NOT the way to go for MKV on iPhone. Use
this tool. It
REMUXES rather than re-encodes the video. Most .mkv files you can find have h264 video streams which the iPhone 4 is completely capable of playing. The only thing that needs to be fixed is the audio. The tool automatically downmixes either dts or ac3 surround sound to aac - the audio is transcoded, but the video stream is passed through. Transcoding video will ALWAYS have some loss in quality, but remuxing the stream will not. BTW that link is my personally packed version of mkvavi2mp4 - the one you download from sourceforge has an mp4box that is incapable of muxing into large (>4GB) mp4's.
This is beneficial not only in that no video quality is lost, but also in that the hardware decoder on the iPhone is used rather than the software encoder in avplayer or cinexplayer. And most of the time you can sync directly to the native iPod app.
I had looked into this for several months - an optimal way to play mkv files on an iPhone, and this is the best way for several reasons. Encoding/downmixing the audio is the most time-consuming step, but since video isn't re-encoded it takes very little time to simply remux, and no quality is lost. It's a very well designed tool
If you can find .mkv files with an h264 video stream and aac 2.0 audio, then it will take about 2 minutes to remux an entire bluray movie from mkv to mp4. But you're most likely going to see that most movies are ac3 5.1 or dts 5.1 - some tv shows, especially web-dl shows, may have AAC audio.
Note: for whatever reason (I'm not sure of the technical details) this doesn't work as well for avi/xvid video streams. Also, you might want to remove the subtitles stream from the mkv if you don't want subs.