As I understand it and E30 and E36 M20, M4X and M5X have the same bellhousing pattern. The M20 at least the engine is tilted slightly differently. All have integral bellhousing except for the 1981 528e which has a separate bellhousing on the Getrag 265 compared to the latter Getrag 260. This is a one-year US model only, with a 2.7 eta version of the M20. The finer points of flywheel, clutch, throw-out bearing, and starter escapes me. There can be differences.
As romkasponka says 1:1 top on the E36 with the same or almost the same ratios across the board. Of these the ZF in the 328i or M3 is the strongest. the Getrag 250 is OK. If you see a Getrag 220 which is in some markets (maybe not the US) which is usually behind a M40, run away fast.
The E30 has OD ratios in the Getrag 240 and 260. These is also the Sport gearbox option in some E30s i.e. 325iS in some markets.
HTH