Is it true that common law courts will not resolve a question without a controversy and will not give governments pre-emptive advice on the legality of laws or regulations?
In U.S. law, federal courts may not consider matters that do not involve an actual "case or controversy" based upon the way that this language granting the federal courts subject-matter jurisdiction in Article III, Section 2 of the U.S. Constitution has been interpreted. The primary exception to this is that federal courts can consider cases that by their nature are almost certain to become moot before the legal process runs its course (e.g., in cases of someone seeking an abortion, or in cases related to end of life health care), as the cases are otherwise likely to recur and escape review.
This U.S. Constitutional limitation does not apply to U.S. state courts and many states allow state supreme courts or another body to issue advisory opinions on the validity of legislation and certain other matters. But, either as a matter of a state constitutional limitation in imitation of the federal model, or under a state statute or common law interpretation, except in the case of clearly delineated exceptions found in a statute or state constitution, a lack of a case or controversy is still a jurisdictional defect in most state courts for most matters. State supreme courts also answer "certified questions" in actual live cases pending in federal courts, of narrow, sterile legal issues that themselves would not be cases or controversies, when there is an unresolved issue of first impression under state law in a case governed by state law (e.g. in a diversity case).
Also, many U.S. state trial courts of general jurisdiction serve a quasi-administrative role, e.g., in handling applications to form new municipalities and special districts, even in the absence of an actual case or controversy, and to process uncontested probate proceedings and uncontested name change applications.
Another odd-ball exception is that in Colorado, the prosecution can appeal rulings of law made in criminal cases where the defendant is acquitted, even though this ruling has no effect (as a matter of U.S. Constitutional law) on the criminal defendant, in order to clarify a point of law in the case with prospective application.
In both the state and federal cases, this is not a bar to issuing declaratory judgments, but the declaratory judgment must have a basis in a genuine case or controversy.
The main way that the desire to have certainty in an advisory legal opinion is handled is to have an executive branch official, such as the attorney-general, or a top Treasury Department or State Department official, or a city or county attorney, issue a researched and reasoned opinion regarding the law which is binding on the government and its employees and agents in the absence of a court ruling to the contrary.
Yes … unless Parliament has given this power
At common law, the courts can only intervene in matters of actual controversy. This goes as far as discontinuing a case if it becomes moot.
However, subject to constitutional constraints, Parliament can give the court whatever jurisdiction they want.
So, in the UK or Australia, Parliament could extend the court’s power, but they haven’t. In Canada and South Africa, they have, and, at least in Canada, the court has held that this is a legitimate exercise of Parliamentary power. In the USA, the courts have determined that, in the Federal sphere, the Constitution does not allow Congress to expand the remit of the courts in such a way.
However, once a court’s role and responsibilities are statutorily or constitutionally defined, it is no longer a pure common law court - it is a court with some common law functions and some statutory functions.
The proposition is not universally true. Canadian courts have the discretion to hear a moot case and have been granted the jurisdiction to issue advisory opinions in response to "reference questions."
A court has the discretion to hear and decide a moot case
The common law does not prevent courts from hearing and deciding a case that is moot. Common law does not require "discontinuing a case if it becomes moot" (contrary to the position of another answer). See Borowski v. Canada (Attorney General),  1 SCR 342. While the Court acknowledged the importance of an adversarial context, judicial economy, and a court's rule as an adjudicator, it nonetheless held that courts have discretion to hear a moot case:
First it is necessary to determine whether the required tangible and concrete dispute has disappeared and the issues have become academic. Second, if the response to the first question is affirmative, it is necessary to decide if the court should exercise its discretion to hear the case. ... In the interest of clarity, I consider that a case is moot if it fails to meet the "live controversy" test. A court may nonetheless elect to address a moot issue if the circumstances warrant.
In Canada and the provinces, the governments may submit "reference" questions of an advisory nature to the Supreme Court of Canada or provincial courts of appeal, and in some provinces to the superior court.
For example, the Supreme Court Act, s. 53 allows the Governor in Council to submit questions of law or fact to the Supreme Court of Canada concerning "any matter... with reference to which the Governor in Council sees fit to submit any such question" and "it is the duty of the Court to hear and consider it and to anwer each question so referred." See also Ontario's Courts of Justice Act, s. 8 and B.C.'s Constitutional Question Act, s. 1.
Leah McDaniel, for the Centre for Constitutional Studies, describes:
The reference process is not grounded in a real, concrete dispute or controversy between actual parties, making it somewhat hypothetical and theoretical.
In 1912, the Judicial Committee of the Privy Council held that it was within the power of Parliament to bestow the Supreme Court of Canada with this advisory jurisdiction (Reference re: references (1912) 3 D.L.R. 509,  A.C. 571 (P.C.)).
The Supreme Court of Canada has also confirmed the advisory nature of the answers it provides to reference questions, while recognizing that they will be treated as authoritative (Reference re Code of Civil Procedure (Que.), art. 35, 2021 SCC 27, at para. 152):
Notwithstanding their advisory — and therefore, in principle, non‑binding — nature, opinions given in references are in practice treated as judicial decisions and are followed by other courts ...
As @Jen said in her answer, this is not a common law restriction. Rather, the most famous use of this is the United States, another Common Law country, but this is a result of the interpretation of the Constitution, specifically Article III section 2 which states that:
The judicial Power shall extend to all Cases, in Law and Equity, arising under this Constitution, the Laws of the United States, and Treaties made, or which shall be made, under their Authority;—to all Cases affecting Ambassadors, other public ministers and Consuls;—to all Cases of admiralty and maritime Jurisdiction;—to Controversies to which the United States shall be a Party;—to Controversies between two or more States;—between a State and Citizens of another State;—between Citizens of different States;—between Citizens of the same State claiming Lands under Grants of different States, and between a State, or the Citizens thereof, and foreign States, Citizens or Subjects.
The general interpretation is that U.S. courts may not issue advisory notifications or hearing cases that are "unripe" which means no controversy exists, or it is moot or resolved through other means (this is why a lot of Lawsuits don't make it to court. Most parties resolve the dispute quietly out of court.). It is worth mentioning that mootness can have an exception if the issue is capable of being repeated but resolved before courts have a chance to hear the case (For example, in cases dealing with abortion legislation where the plaintiff is a woman who's termination of a pregnancy may be affected, the case can still be heard despite the outcome of said pregnancy likely resolving before the outcome of the court case is decided (A court case resolving in less than 9 months of time is a very fast moving case.).
As such, this is not a feature of all Judiciaries that use Common Law structures. It just so happens that American Media tends to produce legal dramas based on American Courts (because no duh) and is widely consumed the world over.
Although South Africa has a mixed legal system I do personally think it very much operates under common law principles.
The constitutional court acknowledges four main ways in which cases come before it.
- As the result of an appeal from a judgment of the High Court or the Supreme Court of Appeal:
- As a direct application to the court
- As result of a lower court deeming laws unconstitutional and that judgment requiring review by a higher authority.
- As a piece of legislation asked for review by parliament.
As it stands in the USA the legal system is already under great pressure. To allow every piece of legislation, that congress is considering, that is even remotely controversial to be allowed a constitutional review would put an unreasonable burden on an already strained justice system.
It is worth noting that although SCOTUS is the highest authority on constitutional matters in the USA it is not the only one.
All courts have the ability to deem laws unconstitutional, as it is in there power to do. Constitutional matters are decided many times more often than what the hundred odd constitutional cases that SCOTUS hears a year may make you think.