Can I make Xcode app icon with 512x512 icon instead of recommended 1024x1024?
Your app icon is displayed in many places, including in Finder, the Dock, Launchpad, and the App Store. To ensure that your app icon looks great everywhere people see it, provide it in the following sizes.

512px × 512px (512pt × 512pt @1x)
1024px × 1024px (512pt × 512pt @2x)

https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/app-icon/

Technical Q&amp;A QA1686 lists the specific uses of each icon size in iOS, but I can't find an equivalent resource for macOS.
You should use an actual 1024px image if at all possible. An upscaled icon may be rejected by App Store Review.