Is it possible to create an ionic app on windows for apk and then transfer to mac and create an ipa file?

I have a question about creating an app on ionic, the situation is that I have windows and my friend has a mac.
Can I write an app on my device and then have him create an app in ipa format for ios?

Yes, as long as you give him the source code of your project so he can build it in Xcode and assuming you add the iOS platform to your project (needs to be done on a Mac) - Getting Started | Capacitor Documentation.

I do something similar. I develop on a Linux machine where I also build the Android version. For iOS, I rent a Mac in the cloud via MacInCloud to build the iOS app. The cloud Mac just clones my Git repo and builds the project in Xcode.