Depends on the structure.
In the US, most residential MBS are pass-through, so the MBS is prepaid.
In Canada, MBS are (or at least were) mostly packaged into non-passthrough structures, so MBS cash flows follow fixed coupon schedule. There are prepayment penalties which are used to absorb the cash flows.
My understanding is that European pfandebriefe ...