Can't you just set up your Office 365 account in Thunderbird? If you want to migrate from a M365 account to a different email service, then your best shot would be to use the SysTools IMAP to IMAP Migration tool.
If your specific destination is Gmail or Google Workspace, you might want to use a tool purpose-built for that exact transfer.I highly recommend checking out the SysTools Zoho to Gmail Migrator. It’s specifically designed to streamline the Zoho-to-Go...