It isn’t possible to simply change the name of an existing team site because of how the architecture works for Office 365 team sites.
For example, you cannot change :
contoso.sharepoint.com to fourthcoffee.sharepoint.com
https://contoso.sharepoint.com/sites/sample1 to https://contoso.sharepoint.com/sites/sample2
If you must change the domain of a team site (contoso.sharepoint.com to fourthcoffee.sharepoint.com) you will need to do the following:
Create a new Office 365 account and use the name that you want to use for the onmicrosoft.com domain as part of sign up.
(Optional) Remove your custom domain from the original account (the one with the team site name that you didn't want)
(Optional) Move any email, files, or other data you may have set up with that account to the new one.
Tip: To move team site content to a new site, follow the steps in this KB article.