If they are softsubs most of the time you can find a demuxing tool (mkvextract works for MKV). If they are burned in (which is to say most AVI files that do not have external files) then you will have to OCR them out (you will also have to OCR them if they come from a DVD or they are in vobsub), there are many tools for it although the classics are subrip ( http://www.videohelp.com/tools/Subrip ) and subtitle edit ( http://www.nikse.dk/SubtitleEdit/ ); the latter is somewhat newer but I am not about to dismiss the former just yet. If it is just text on black background then OCRing is easy enough, if tedious, but proper embedded in moving images subtitles are more annoying (you start having to wind contrast and colourisation bars to make them stand our more and manually prodding an awful lot more). On anime- at one time the lesser groups made nice subtitles but ultimately hardcoded them, ostensibly to prevent them from being ripped off, so make of that what you will.
The other part, although if you are using a proper subtitle library (which most people playing in open source video will be doing) it is less troublesome, is making sure they are in a format it understands. Broadly speaking there are 4 big formats if you are not authoring a DVD or similar and the less said about what MP4 calls subtitles (MP4 timed text) the better.
Said formats are
SRT- basic text based stuff. There is a tiny bit of markup available but for the most part it is time and the text that is displayed at that time.
SSA and ASS (these are the ones that make your anime subtitles nicely coloured with karaoke styling and whatnot). I am counting these as two and although Advanced Substation Alpha was supposed to take over from Sub Station Alpha subs in practice people spent a long time learning SSA (and it does do an awful lot of good stuff) and it did not really go away.
vobsub (this is the sub and idx files that often come with downloaded films- they are pretty much just repacked versions of the DVD subs which means they are actually just pictures and which is why they often sit around the ten meg mark).
Beyond this there is not a lot worth covering unless you are actually interested in subtitle editing (in which case pick up a copy of http://www.aegisub.org/ , http://sourceforge.net/projects/subtitlecreator/ and http://www.urusoft.net/products.php?cat=sw&lang=1 and bang them all together with the programs I have already linked). You should not have to deal so much with converting the subtitles to different framerates (or if you are slicing things up) but the various tools I just linked will make that a breeze as long as you know what it starts as and what it is going to.