It seems that the Office 365 does not support custom Imap Keywords.
This is outlook.office365.com response for Inbox:
OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
And this is response of a mail server which supports custom Imap Keywords:
OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft test01 \*)] Flags permitted.
\* sequence in the second case. If present, the server supports custom Imap Keywords as defined in RFC 3501:
The PERMANENTFLAGS list can also include the special flag \*, which
indicates that it is possible to create new keywords by attempting to
store those flags in the mailbox.
Since the Office 365 does not include the
\* flag in the response it suggests that it does not support custom Imap Keywords. There is no workaround for this case. We are sorry.