Yes. To transfer contacts from Android to iPhone, backup contacts on Android phone and restore them on iPhone.
Likewise, to transfer contacts from iPhone to Android, backup contacts on iPhone and restore them on Android phone.
As simple as that!