Hi,
You can do it with Azure b2b collaboration, but it is a bit of mess, before you continue with any configuration you have to design it, in order to avoid security leaks.
If is the same as you do a forest trust between forest domains.
Below you will find a link with the appropriate documentation:
https://learn.microsoft.com/en-us/azure/active-directory/external-identities/what-is-b2b
After you make the configuration you can use the resources from the other tenant to the VM or any other resources.
Last but not least check also the limitations.
BR,