I was recently asked this question by a customer, as we were starting to build out a migration process. My immediate thought was no, we need to migrate the mailbox first then assign an Exchange Online license to mailbox. The reason why this was first reaction was primarily due to BPOS. (BPOS was the version of Exchange Online prior to Office 365.) In BPOS, once you assign a license to user, their mailbox becomes active. This can be problematic when you are piloting some mailboxes and you are not ready to migrate in all mailboxes. Thus, it’s critical you plan out when you enable mailboxes.
Exchange Online in Office 365 is a bit different. The primary difference is the integration with Exchange on-premise through a Hybrid configuration. This integration essentially extends your on-premise environment to Exchange Online, allowing Exchange Online to leverage more information about your on-premise environment. With an Exchange Hybrid configuration established, you can assign Exchange Online licenses to as many synchronized accounts that are listed in Exchange Online, as you choose. The reason why this is important is that it’s one less step you have to worry about, come migration. Assigning a license to a synchronized account is only an allocation until the mailbox is actually migrated. The license does not create a second mailbox, in Exchange Online, while those mailboxes are located in Exchange on-premise.
On the flip side, if you do not have an Exchange Hybrid configuration in place, any license activations will cause those mailboxes to appear. So, as an example, if you are preparing for a migration from GroupWise or Lotus Notes, you will not want to enable license for those mailboxes until you are ready to perform migrations or establish those accounts. In a non-Hybrid configuration, Exchange Online has no way of knowing a mailbox does not exist on-premise. If you already have users working in Exchange Online mailboxes and you enable licenses for users that are not ready to migrate, you will cause email delivery to not route to the proper mailboxes. The Exchange Online users will end up emailing unused mailboxes, since they will technically be active and not just an object redirect mail to on-premise.