To put subtitle in an avi you need:
And for mpegs.........well you wanna put it on an mpeg file and write it on dvd as mpeg or as dvd(vob)?
'Cause in the case of vob you could use dvd maker software (like I use DVD workhop 2) and after importing it in you can add subtitles (wich will be optional at playback, you have it if you want or not have it)! Though DVD Workshop doesn't support .srt only it's own .txt but Subtitle Workshop can convert it for you! Or you can look for a dvd maker that supports .srt.
If you wanna put it on a mpeg file and keep it as mpeg then I would convert the mpeg to avi then use virtual dub then convert it back to mpeg! Though there has to be an easier way around for that too but I don't know about it!
I hope I could help atleast with the avi part!