There are contracts where consumer deposits are required to be held in trust, requirements that mostly, but not entirely, arise under state law in the U.S.
For example, many states require that landlords hold security deposits for residential rental properties in separate trust accounts, and almost all U.S. jurisdictions require that attorneys hold prepayment for legal services in trust for the consumer until the fees are earned.
As another example, in Colorado, if a property owner make a payment to a general contractor for work on real property such as building or renovating a building, the general contractor is required to hold those funds in trust and not make payments to itself from those funds, until all subcontractors and material suppliers on the job have been paid in full and have no lien claims.
In the same vein, many construction contracts, especially for governments acting as consumers, require contractors to be "bonded and insured" meaning that a third-party bond company is responsible for paying claims against the bonded company even if the bonded company is insolvent.
It also isn't unusual in complex commercial transactions between sophisticated big businesses, for the parties to negotiate that certain funds related to a transaction be held in a bankruptcy remote trust, or that the work be done by a "bankruptcy remote entity."
But this is rarely the case when large numbers of consumers enter into small transactions with a big business. As @DaleM rightly notes, a business in a position to impose a contract of adhesion on consumers on a take it or leave it basis, can get away with it, and one simply might want to be wary about doing business with financially insecure businesses, if possible, even though financially secure businesses may charge more.
A common theme is that consumers (maybe business to business or government to business) insist on trust-like or bond-like or insurance-like or collateral-like protections for deposits in transactions where the loss suffered if the security deposit was lost would be a major economic blow to the consumer in light of the consumer's overall financial situation. In contrast, these protections are foregone when the amount of a security deposit is small enough to be merely a survivable nuisance that may happen some small percentage of the time that the consumer engages in such transactions.
This reflects an economic and policy judgment that the trouble of treating small consumer deposits as if they were trust funds isn't worth the transaction cost trouble of doing so.
Priorities Under U.S. Bankruptcy Law
In part to address the imbalance of power in this situation, claims to recover consumer deposits for unperformed goods or services owed by the debtor do have a priority under U.S. bankruptcy laws relative to general unsecured creditors of up to $1,800 per consumer.
Specifically, these are seventh priority claims in bankruptcy pursuant to 11 U.S.C. ¶ 507(a)(7). They are behind claims secured by collateral to the extent of the value of the collateral (priority zero, so to speak), priority one alimony and child support claims, priority two costs of administering the estate, and priority three to six claims which include several kinds of claims that amount to up to about $20,000 of unpaid wages and benefits per employee and about $4,000 of unpaid amounts owed to farmers per farm for their crops. But security deposit claims are ahead of a variety of tax claims, FDIC claims, DUI personal injury claims, and general unsecured creditor claims. They are also ahead of the claims of stockholders.
As a practical matter, when you are doing business with a business entity rather than a sole proprietor, there are no child support or alimony claims, and most businesses that have lots of transactions with retail consumers don't buy crops directly from farmers, so consumer deposit claims actually have a very high priority in bankruptcy and are usually repaid in full except in the very most catastrophic business collapses under U.S. law. So, while it isn't quite as good as holding those funds in trust, the bankruptcy priority comes close from the perspective of providing a practical benefit to every day small consumers doing business with large firms that go bankrupt.
Superficially, at least, it appears that Canada does not have a similar priority for consumer security deposit claims in bankruptcy, although it could be that this arises in some back door manner invisible to practitioners unfamiliar with it under court interpretations of Section 70 of the Canadian Bankruptcy and Insolvency Act (BIA) which governs creditor priorities in bankruptcy in Canada.
For example, the consumers may have an implied in law security interest in those funds of which I am not aware. It may also be that there are specific kinds of transaction in which deposits do have to be held in trust, just as there are in the U.S., even if that isn't true as a general rule.
Finally, if one pays by credit card, it is often possible to reverse a charge like this one, pushing the risk of bankruptcy loss from the consumer buying with a credit card to the bank issuing the credit card, particularly if action is taken promptly.