Subtitle support in MP4 is limited, you either have to use bitmap-based VOBSUB (not really an option here), or 3gpp times text (supported in ffmpeg as -c:s mov_text). For soft subtitles, you would have to use (assuming the video is h.264 & the audio is AAC, which most MKVs are; if the video or audio isn't compatible with MP4, ffmpeg will throw out an error & stop):
...however, that will not preserve any fancy formatting. If you want that in an MP4, I think you'll have to hardcode the subtitles iwth the 'subtitles' video filter, and before that you'll have to extract the subtitles into a separate file. Note that I haven't actually tested if this preserves any fancy text, I've only used it with plain SRT subtitles:
ffmpeg -i input.mkv -c copy -c:s mov_text output.mp4
The version of ffmpeg in the repositories doesn't have access to the subtitles filter, you can see options for getting an up-to-date version from here.
ffmpeg -i input.mkv -map 0:s:0 subtitle.ass
ffmpeg -i input.mkv -filter:v 'subtitles=subtitle.ass' \
-c:v libx264 -preset veryfast -crf 22 -c:a copy -sn output.mkv
See also: x264 and AAC encoding guides.