Hi @JUHYUN BAE ,
Thanks for reaching out.
As @Vasil Michev mentioned, it's not necessary to have them match, but it's usually the recommended approach. For example: when you synchronize your on-premises directory with Azure AD , you have to have a verified domain in Azure Active Directory (Azure AD). Only the User Principal Names (UPNs) that are associated with the on-premises Active Directory Domain Services (AD DS) domain are synchronized. However, any UPN that contains a non-routable domain, such as ".local" (example: billa@Company portal .local), will be synchronized to an .onmicrosoft.com domain (example: billa@Company portal .onmicrosoft.com).
If you currently use a ".local" domain for your user accounts in AD DS, it's recommended that you change them to use a verified domain, such as billa@Company portal .com, in order to properly synchronize with your Azure AD verified domain.
Similar way, if on-premises custom domain for example, fabrikam.com which is routable and same domain name has been added in Azure AD then users will just sync by default since UPN suffixes are the same.
In additionally, you can also populate proxyAddresses attribute for the user to have multiple SMTP address which synchronize to Azure AD.
The following article is worth checking out as it speaks about managing custom domain and SMTP address in Azure AD:
https://learn.microsoft.com/en-us/microsoft-365/enterprise/prepare-a-non-routable-domain-for-directory-synchronization?view=o365-worldwide
https://learn.microsoft.com/en-us/troubleshoot/azure/active-directory/proxyaddresses-attribute-populate
------------------------------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.