Yes you can. First to be able to sync from old server you can make “master password” to be able to log in any account on old server. This should cover syncing messages without knowing each individual password. (Note that as MC admin you need to know only password to old system not new to sync and some reading https://doc.dovecot.org/2.4.4/core/config/auth/master_users.html#master-users-passwords)
Second problem is users password. I believe MC use standard internal password hashing as it. It should support mixed schema hashes. So you can simply make accounts using UI/API and than copy (by SQL query) old hashed password. If old hash is supported you are fine.
It would be nice to rehash old hashes to new style, not sure if MC does it by default but in history they must solve this so it would be worth to check how they made it. It’s always better to use safer variant.
I MC I never done this, so you need to test it.
Edit: in case those mixed hashes does not work you can try external identity provider (docs) it should give you enough space to manage old password hashes.