I guess it would be possible - at least for the GNU Mailutils version (not the Emacs version as it does not support imap or encrypted POP3). However, I guess it would also involve adding a whole HTTP request library and an Oauth2 library to obtain authentication/refresh tokens. This is of course assuming that MS does allow an application ID to be used with IMAP (to be confirmed).
This also only helps with MS Office365/Outlook access - it doesn't help with Gmail or any other provider who transitions to nly support Oauth2. As mentioned by others, the big stumbling block here is that each provider is able to implement Oauth2 with their own custom workflow, which makes a general generic solution difficult to define. The solution will probably require some sort of 'pluggable' Oauth2 layer, which might include Oauth2 authenticators for popular mail providers and a facility to add a custom one for others.