Azure AD Connect synchronizes the on-premises SamAccountName to Azure AD as OnPremisesSamaccountName, and it's mapped to "accountName" in the metaverse.
For the newer versions of Graph API, it's exposed using either of these calls in Graph Explorer:
https://graph.microsoft.com/v1.0/users/synceduser@example.com?$select=onPremisesSamAccountName
https://graph.microsoft.com/beta/users/synceduser@example.com
Related threads, for reference:
https://learn.microsoft.com/en-us/answers/questions/95273/how-to-add-samaccountname-as-a-soirce-attribute-in.html
Let me know if this helps.