the bell housing will vary due to mating up to different engines, but where they bolt up to the center casing will be the same and the ratios will be ratios chosen by nissan or honda or mazda, the splines on the output shafts will be specified by these companies as well to suit their respective drive shafts, but you will be able to put gears from a mazda box into your S15 and it will fit up fine, just the ratio will be different, syncros, bearings, selector fork, spring & ball bearings will be all the same.
to suit say a Rx7 gearbox to a SR, you would just get a adaption made for the bell housing taking into account shaft length so it sits either into the S15 flywheel or the crank as on S14/S13, and if the output shaft has different splines a Rx7 driveshaft front section, fitted to the SR front section and you will have the same gearbox, if you buy a gearbox from a MX5 for $400 and a S15 spec r cost $2000, $1000 in custom work and a replacement box just cost you $1400 instead of $2000, then blow the crap out of the box get another one from a MX5 and the custom work is already done.