they can. if some of the circumstances that allowed you to get the loan changes. They can terminate the loan agreement and demand repayment in full immediately.
I think this is pretty common in loan agreements but I would guess it's rare to have this actually exercised because usually the change in circumstances is going to be something that's going to make repayment harder (no one is cancelling the loan because you notified them that you now make way more money). Trying to collect the full loan from someone with less money is going to be tough and if they then put them on a payment plan then they didn't achieve anything.
Plus it isn't great for customer relations and poor people are great clients for a bank who knows they can hit them for more and more fees.
https://www.finanzcheck.de/kredit/kredit-kuendigung/