Can I create a game in Windows, then copy it to a mac to compile in xcode?

I’ve noticed that you can build your app for iOS on windows in Unity and it creates a bunch of files which I assume would need xcode to compile further.

So my question is can I just grab a cheap £50-£100 mac mini on ebay and just have xcode on there to compile these files and release the app? Or would I have to have Unity on the mac aswell?

Yes, but check out xcode requirements as it’s no longer supported on older OS.
My friend once bought an old macbook and he couldn’t run xcode as os was too old.