Hi. I'm Brian and I'll try to help.
If you purchase a Personal or Family subscription, the custom domain should still apply. However, as of November 20, 2023, Microsoft will no longer support custom domains with Microsoft 365 Personal or Family. It will be supported with the Microsoft 365 business subscriptions. Custom domains should still work if you have one but you won't be able to create a new one. My personal inclination is to not use a feature for which there no longer is support because if it were ever to break, it would never be fixed and there would be no recourse. It's not that much more expensive to get a business subscription if a custom domain is important to you when using Microsoft 365 and you don't need to be an actual business to subscribe.
I use a custom domain with the free version of Outlook.com. Microsoft (or GoDaddy) is not the registrar. I have my custom domain point to a mailbox that I then forward to my @outlook.com address and I have the custom address configured as an alias for that Outlook.com mailbox. I also have it set as the default From address. If I use the web interface, the From address is my custom address and people receiving my messages see that address whether it's a new message or a reply to an existing message. It doesn't work as straight-forward with a mail client (you would see "on behalf of" in the From address). However, there's a work-around for that as well if you create a send-only account in the client that sends messages you want to show as From the custom address through the real custom domain mailbox rather than relaying through Outlook.com. It can take just a bit more thought about the From address when sending, but I'm so used to it now I rarely make a mistake. I most often use a Chromebook for my normal computer work and since that uses the web interface, the From is always good.
As long as the code you purchase is a genuine Microsoft 365 code and not, say, a code for Microsoft Office Professional Plus, which is often a pirated license, it shouldn't make a difference.