This is not an every day task but when I have associated an internet domain with Office 365 and then want to remove it you need to ensure the domain is not used anymore by any objects in Office 365 – like email addresses or sign in name.
It was a painful task and you were not able to continue until no more dependencies were detected. But now it is getting easier to remove a domain from Office 365: the system is now able to search for you across your tenant any object still using the domain AND remove it for you.
To remove the domain just connect with a global admin to your tenant (https://portal.office.com) and go to the Setting\Domains section
Select the domain you want to remove and choose Remove
Then the system is reminding you there could be some dependencies; if you click Remove now, the system will remove automatically all these decencies; off course if you are using directory synchronization and/or Exchange Hybrid you will have to remove the domain from your on-premises too
Et voilà, the domain has been removed
It may take some time to fully complete the removal process, once completed your domain is freed from Office 365