https://learn.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-group-writeback
The only groups that can be written back at this time are Microsoft 365 groups, also known as Unified groups. I believe dynamic membership M365 groups will work with this, and the documentation does not mention anything about them being ineligible.