Hi Yonggan (npub1erl…rm9k)
Matrix is an open standard. It’s not a vendor, and has no vendor lock-in.
If you self-host (as govts do), then it’s simple to move your server to different underlying infrastructure.
If you’re using a hosted service: Any decent paid hosting service should let you take your data with you, so there’s rarely a lock-in from paid hosting services.