Hi rak,
According to your description, I understand that you want to change the free domain name “companyA.onmicrosoft.com” to “companyB.onmicrosoft.com”.
However, I would like to explain that the default domain “companyA.onmicrosoft.com” is related to billings and other services, in this case, it cannot be directly changed.
Thanks,
Allen Zhang