Yes, we can test Mobile Application on Different Versions of Android & iOS. But Application to be tested should support your android and iOS versions.
If you are testing any Android Application then it won't work on iOS platform and Vica-Versa.
As Mobile industry have lots of Mobile devices and OS versions in market, so testing on each and every mobile device for different OS version is not possible.
We can use real mobile devices, emulators, or both for testing mobile applications. The answer depends on what you want to test. For example, emulators are good for user interface testing and initial quality assurance, but real devices are essential for performance testing, while device cloud testing is a good way to scale up the number of devices and operating systems.