How to migrate from Android 5.1 to iPhone 8?
Generally speaking, yes.

I imagine there is a minimum OS version on both Android and iOS but there is an officially supported (by Apple) method which they detail here. There is also an app "Move to iOS", that goes on the Android phone available in Google Play.