I have a SharePoint Team site, SiteA, that is on the top level (it is not a subsite of any other site). It is not connected to an Office 365 group. I have another SharePoint Team site, SiteB, also on the top level and not connected to an Office 365 group. How can I make SiteA a subsite of SiteB (I don't mean copying files, I mean changing the actual environment)? If they were not on the top level, I would utilize the site manager described in this answer, but that does not work for top level sites. I am a SharePoint Administrator.
Promote Site B as a hub site and add Site A to the Site B. Then configure a Megamenu, using this you can manage the site from the same navigation.
In the long run, in the world of modern SharePoint online Hub Sites and Mega Menu are the recommended one, Microsoft does not recommend go with sub site.
However, if you still opt go with the sub site, we just can't convert or map a main site as a sub site under another site.. we need to migrate the main site as a sub site under another main site, for that we have to use third-party migration tool, there are many migration tools available in the market, but per my knowledge ShareGate will be best fit for this.
For details on hub sites in SharePoint online, you may refer to the below article :
You cannot change a subsite to a parent site and you should avoid subsites and use hub sites instead.
What you would need to do is create a new subsite in SiteA and then use content migration (i.e. Sharegate among many other) tools to migrate the content from SiteB to the new subsite.
As per the new recommendations, go with flat architecture instead of nested architecture for SharePoint sites.
Flat architecture: A system in the modern SharePoint experience in which every site is a site collection, and all can be associated to a hub site.
Nested architecture: An hierarchical system of site collections and sub-sites with inherited navigation, permissions, and site designs typically used in classic SharePoint