Possible to selectively choose folders to sync at set-up time of OneDrive for macOS?
I have run into and struggled with the exact same issue with setting up OneDrive app for macOS. Here's what I have observed setting it up on multiple personal Macs.

Soon after logging into the app, it appears to start syncing all the files and folders, and trying to access the app preferences result in a spinning beachball. While it appears that the app is trying to download all the data from your OneDrive cloud storage, in reality that's not the case.

What's happening is that the app is fetching the metadata for all the files on your cloud storage without actually downloading the files themselves. I have experienced this process to take unusually long time, thereby giving an impression that it's trying to download all the files.

Also, the app by defaults comes configured with a setting called Files On-Demand enabled. Here's how it looks like in the app preferences window:



What this does it gives you an impression that all the files and folders are available in Finder. However, when you try to access any by trying to copy or open, the app actually starts downloading the file. The Finder simply shows the file icon normally and even trying to perform a Quick Look triggers a download.

In my experience, the app is programmed such that the app preferences are not accessible until this initial fetching of metadata is complete. But as soon as this initial fetching of metadata is complete, the app preferences become accessible, and then you can choose the folders to sync selectively. If you get an error when trying to select some folders and save, try relaunching the app.

Once you have selected the desired folders, you may also want to turn off Files On-Demand. Doing so would actually download the files for the selected folders and would even let you work with them in offline mode.

I find this feature of the app very annoying. Also, I feel that the overall UX of the app is very confusing and frustrating. You can consider sharing feedback on this with Microsoft here: OneDrive on Mac - Feature Suggestions for Microsoft OneDrive.

Now to address your specific queries:


  
  Is it possible to configure through the Terminal or otherwise which folders to selectively sync in the OneDrive app for macOS?
  


I can't conclusively answer this in no, but there aren't any publicly known command-line that can do this.


  Or, to select the folders to sync during the setup procedure of the app?


I have not found this feature present in the current version of the app.