If you're targeting a platform that supports Windows such as .NET, .NET 6/7, Xamarin, etc and you've installed the appropriate workloads then yes you can build Windows code and then run it on Windows. Refer to the product page for more information on the platforms that are available.
Can I use Visual Studio for the Mac to cross compile code for Windows?

Mike Puckett
1
Reputation point
I use a Mac and need to compile code that's ultimately destined for Windows. The code is in a git repository. Can I download the code on the Mac, compile it on the Mac, but then run it on Windows?
Developer technologies | Visual Studio | Setup
1,207 questions
Developer technologies | Visual Studio | Other
5,454 questions
Community Center | Not monitored
46,246 questions