Another answer suggests that in England and Wales they are not. But under what provisions wouldn’t they be? Why or why not?
The courts are generally loath to recognise that a party has anything but an economic interest in the performance of a contract.
And that the party's interest is not in strict performance, but in either performance or the money's worth of that performance.
From that perspective, so-called punitive damages are outlawed because firstly it attempts to undermine the policy against requiring strict performance, and secondly it seeks to reconfigure the court's normal rules about how damages are calculated for non-performance.
The trouble in this area is in distinguishing punitive clauses, from either a commercial scale of charges, or from "estimated damages".
Because in some cases assessing damages may be difficult, and a great deal of legal dispute could ensue in regard to the method of calculation and the standard of evidence, the courts have recognised this practice.
I don't have a reference to hand, but I suspect the first case in which this practice of recognising "pre-estimated damages", did not concern charges which were alleged to be penalties. It probably concerned a case where the actual damages had varied significantly from the pre-estimate, and the question was simply whether the estimate (which nobody was inclined to regard as punitive at the time the contract was formed) was in fact binding when circumstances changed later.
In practice, if a term is alleged to be a penalty clause, and prima facie it may be, then ultimately the method of calculation is going to get pulled to pieces for examination and justification in court - the very thing that a genuine pre-estimate is trying to avoid.
The other issue is with contracts that are essentially penalty contracts, but which are drafted in terms of charges for various contingencies or as dramatically escalating scales. The prime example is car parking. The courts are known to recognise a limit, but there is a large grey area without clearly defined bounds.
So ultimately the answer is that punitive clauses are not enforceable, but discerning between what is punitive and what isn't is where all the difficulty is.
The position in Canada flows from English common-law.
When parties agree on an amount to be paid upon a particular breach, this is sometimes understood to be what is called a "liquidated damages" clause. A liquidated-damages clause is enforceable when it is a genuine pre-estimate of the damages upon beach:
A penalty is the payment of a stipulated sum on breach of the contract, irrespective of the damage sustained. The essence of liquidated damages is a genuine covenanted pre-estimate of damage.
(Canadian General Electric Co. v. Canadian Rubber Co., (1915) 52 SCR 349)
the question is not resolved merely by referring to the assertion to that effect in the provision itself and cases are not hard to find wherein sums have been held to be liquidated damages though called penalties in the contracts and vice versa.
(Dimensional Investments Ltd. v. Her Majesty the Queen,  Ex CR 761)
The enforceability of a liquidated damages provision in an agreement engages two competing objectives: freedom of contract versus the right of the courts to intervene in a given case to relieve against an oppressive or unconscionable result flowing from enforcement of the liquidated damages term. It is well settled that the enforceability of such a term turns on whether it is a genuine pre-estimate of the expected loss that a party will sustain in the event of a breach of contract or a penalty clause so oppressive or unreasonable that equitable intervention is justified to prevent an injustice.
Judicial interference with a liquidated damages provision will be justified if enforcement of the term results in payment of a sum which is extravagent and unconscionable in comparison with the greatest loss that could conceiveably be proved to have followed from the breach.
Conversely, a liquidated damages provision is more likely to be enforced where the claim approximates the amount to which the claimant would otherwise have been entitled according to principles of general contract law.
(Super Save Disposal Inc. v. Blazin Auto Ltd., 2011 BCSC 1784, paras. 26, 31, 32)
One rational for not allowing clauses which would impose a penalty that is not a genuine pre-estimate damages is that these cut against the availability of "efficient breach."
The law which forbids punitive contractual terms in England and Wales derives from common law precedent perhaps best described by Lords Neuberger and Sumption in ParkingEye v Beavis:
The penalty rule in England is an ancient, haphazardly constructed edifice which has not weathered well, and which in the opinion of some should simply be demolished, and in the opinion of others should be reconstructed and extended. For many years, the courts have struggled to apply standard tests formulated more than a century ago for relatively simple transactions to altogether more complex situations. The application of the rule is often adventitious. The test for distinguishing penal from other principles is unclear.
They go on to cite 19th-century authorities expressing difficulty determining the precise basis for the principle, so an answer here that confidently declares where the lines are is probably inaccurate.
Written in 2013, it is perhaps the most recent authoritative application of the principle, and should be noted that its outcome was that a parking contract where the charge jumps from zero to £50 the moment you overstay beyond the allowed time does not inherently amount to a penalty within the meaning of the law.