In Germany is the situation as following:
As already answered, if you don't pay the deposit, you can be sued. Here is a Google translation from here ("Tenant does not pay deposit - what to do?")
If the tenant does not pay the deposit in whole or in part, the landlord can collect it in court. To this end, he can either file a lawsuit or apply for a payment order.
Since the change in tenancy law in 2013, non-payment of the deposit has been expressly provided as a reason that entitles the tenant to terminate without notice. Accordingly, landlords can terminate without notice without warning if the tenant is in arrears with the payment of the deposit in an amount that corresponds to two basic rents.
And here is in detail "Terminating a sublease - this is how the main tenant or subtenant proceed" (again Google-translation):
When it comes to terminating the sublease agreement, it depends, among other things, on whether the parties have agreed a time-limited sublease agreement or a time-unlimited sublease agreement. In order to clarify this question in detail, the agreed sublease agreement can be viewed.
A temporary sublease contract cannot normally be terminated prematurely by either party before the agreed rental period has expired. Each party must wait for the rental period to expire. The lease then ends automatically without the need for notice.
In case of a unlimited sublease contract it makes a difference it you subrent a room (here again different if with or without furniture) or a whole apartment. In case you subrent an apartment the website cited above says
The tenant can, on the other hand, terminate the contract as normal with the normal notice period of 3 months.