Thank you for reaching out.
Based on your question here, I understand you have Ubiquiti UDM devices on-prem and you wish to know if you can set-up a S2S VPN on Azure from this device.
Based on my understanding above, as documented here in this VPN devices document
In partnership with device vendors, we have validated a set of standard VPN devices. All of the devices in the device families in the following list should work with VPN gateways.
From Ubiquiti I see that only EdgeRouter device family has been validated.
Although not validated I did find this blog post by Thomas Maurer suggesting that Ubiquiti UniFi Dream Machine USG to an Azure VPN Gateway did work.
I will highly recommend you to try this set-up in a test environment first, to validate the connectivity is working fine.
Hope this helps! Please let me know if you have any additional questions. Thank you!