Hello,
Using one configuration file between different models is not highly recommended.
The difference between hardware versions is number of VLANs supported, number of MAC addresses supported - more information can be found in the release notes for each firmware. So, different hardware versions will not be such a problem.
If you anyways decide to try with one config file on different models - it is better to have them all upgraded to the same firmware version, as there you may have differences in settings/features.
Also, another thing if you decide to try it - you may configure the settings that will be equal across all switches, upload the configuration and then configure the differences on each manually - for example, assigning VLANs to ports, applying port security, etc.