Yes - there are two limitations to be aware of:
You can't transfer a domain to or from Office 365 unless you registered the domain at Office 365.
You can't transfer an Office 365 domain to another registrar until 60 days after you registered it with Office 365.
Follow the steps below to get the code at Office 365, and then go to the other domain registrar's website to set up transferring your domain name to that registrar.
Choose Domains after you log in to the Office 365 admin center.
Select the Office 365 domain that you want to transfer to another domain registrar, and choose Domain settings.
Under Privacy Setting, choose Enable domain transfer.
Follow the steps to prepare for transferring your domain.
After you get the code, go to the website of the domain registrar where you want to manage your domain name going forward and follow their directions for transferring a domain (search for help on their website).
If you need to see the code again, on the Domain settings page in Office 365, choose View authorization code for domain transfer.
After the transfer is complete, you'll renew your domain at the new domain registrar and manage your domain's nameservers there.