Thank you for reaching out to us. As per my understanding you want to sync On premise DN attribute to Azure ( by passing the value via ExtensionAttributeXX).
I have verified this issue in my lab and I see we do sync DN value to Azure and the same can be seen from Graph Explorer, below are the screenshots for your reference.
However I am sharing the steps of creating custom inbound sync rule as well on how to pass the DN information to ExtensionAttributeXX ( 1 to 15 ), you can use any attribute which ever is not in use.
Note: No need to create Outbound rule here at this point, As out to AAD - User ExchangeOnline rule has ExtensionAttributeXX defined.
Post creating the sync rule, perform initial sync to trigger the changes "Start-ADSyncSyncCycle -PolicyType Initial"
Let me know if you have any questions or if you need any help in configuring the same, happy to assist you offline.
Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.