Dear @Ashutosh Chavda ,
Thank you for your post in our forum.
According to the test and research, unfortunately there is no way to export folders and sub-folders across sites. I tried to make the list name into a csv table as the basis for the PowerShell loop to read, but it still could not be achieved.
Currently you could get all folder and sub folder from a single list or library. It is recommended that you could first export the folders to csv of each list, and then combine them into one.
For more information about export list folders to csv:
SharePoint Online: Get All Folders from List or Library using PowerShell
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
Hope it could help you a little.
Should you have any questions or concerns, please do feel free to contact me.
Yours sincerely,
Renjie Sun
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.