There was an interesting question posted on the O365 community forums: how does the “Ext” field visible under “Work Info” for the user in the Azure AD portal ties in with the Office phone attribute? Moreover, it is possible to populate this field from the on-prem AD?
Well, the answer is quite simple: you can use the telephoneNumber AD attribute and append the extension to it using the format: +123456×789 where the fist part will be the actual phone number and the part after ‘x’ will be the extension. Here’s how it looks like in the ADUC console:
And here is how it will look in Azure AD (go to Active Directory -> select the AD in question -> Users -> select the user in question -> Work Info):
Hope this helps!