UPDATE: I only saw the U.K. tag after I wrote this answer.
This update addresses the answer to the question under English law which is the most likely version of U.K. law to apply and because most people in N. Ireland or Scotland would not ask about U.K. law and would ask about N. Irish or Scottish law instead as they would be aware of this distinction. Keep in mind that the relevant law would be different in England and Wales, in Scotland, and in Northern Ireland, respectively. Despite the saying "common law" there is not actually a common law of torts that applies to all of the U.K. in all circumstances, although the rules tend to be similar to each other.
In English law, as is often the case with legal questions, the detailed facts and circumstances are necessary to decide the issue and the judge (these cases would not be tried by a jury in England) apply the relevant legal test, set forth below to the specific facts. The question does not include enough of the legally relevant facts to do so, and even if it did, a judge has wide discretion in applying the law below to the facts.
According to Wikipedia: "In English law, occupiers' liability towards visitors is regulated in the Occupiers' Liability Act 1957. In addition, occupiers' liability to trespassers is provided under the Occupiers' Liability Act 1984." The 1984 act is similar to the common law rule discussed below, and is discussed in historical context with some key case law here. The full text of the act, as amended over time, is here. The relevant act states (with the most pertinent parts to this question in bold):
Duty of occupier to persons other than his visitors.
(1)The rules enacted by this section shall have effect, in place of
the rules of the common law, to determine —
(a)whether any duty is owed by a person as occupier of premises to
persons other than his visitors in respect of any risk of their
suffering injury on the premises by reason of any danger due to the
state of the premises or to things done or omitted to be done on them;
and
(b)if so, what that duty is.
(2)For the purposes of this section, the persons who are to be treated
respectively as an occupier of any premises (which, for those
purposes, include any fixed or movable structure) and as his visitors
are —
(a)any person who owes in relation to the premises the duty referred
to in section 2 of the M1 Occupiers’ Liability Act 1957 (the common
duty of care), and
(b)those who are his visitors for the purposes of that duty.
(3)An occupier of premises owes a duty to another (not being his visitor) in respect of any such risk as is referred to in subsection
(1) above if
(a)he is aware of the danger or has reasonable grounds to believe that it exists;
(b)he knows or has reasonable grounds to believe that the other is in the vicinity of the danger concerned or that he may come into the
vicinity of the danger (in either case, whether the other has lawful
authority for being in that vicinity or not); and
(c)the risk is one against which, in all the circumstances of the case, he may reasonably be expected to offer the other some
protection.
(4)Where, by virtue of this section, an occupier of premises owes a duty to another in respect of such a risk, the duty is to take such
care as is reasonable in all the circumstances of the case to see that
he does not suffer injury on the premises by reason of the danger
concerned.
(5)Any duty owed by virtue of this section in respect of a risk may, in an appropriate case, be discharged by taking such steps as are
reasonable in all the circumstances of the case to give warning of the
danger concerned or to discourage persons from incurring the risk.
(6)No duty is owed by virtue of this section to any person in respect of risks willingly accepted as his by that person (the
question whether a risk was so accepted to be decided on the same
principles as in other cases in which one person owes a duty of care
to another).
6A)At any time when the right conferred by section 2(1) of the
Countryside and Rights of Way Act 2000 is exercisable in relation to
land which is access land for the purposes of Part I of that Act, an
occupier of the land owes (subject to subsection (6C) below) no duty
by virtue of this section to any person in respect of—
(a)a risk resulting from the existence of any natural feature of the
landscape, or any river, stream, ditch or pond whether or not a
natural feature, or
(b)a risk of that person suffering injury when passing over, under or
through any wall, fence or gate, except by proper use of the gate or
of a stile.
(6AA)Where the land is coastal margin for the purposes of Part 1 of
that Act (including any land treated as coastal margin by virtue of
section 16 of that Act), subsection (6A) has effect as if for
paragraphs (a) and (b) of that subsection there were substituted “ a
risk resulting from the existence of any physical feature (whether of
the landscape or otherwise). ”
(6B)For the purposes of subsection (6A) above, any plant, shrub or
tree, of whatever origin, is to be regarded as a natural feature of
the landscape.
(6C)Subsection (6A) does not prevent an occupier from owing a duty by
virtue of this section in respect of any risk where the danger
concerned is due to anything done by the occupier—
(a)with the intention of creating that risk, or
(b)being reckless as to whether that risk is created.
(7)No duty is owed by virtue of this section to persons using the
highway, and this section does not affect any duty owed to such
persons.
(8)Where a person owes a duty by virtue of this section, he does not, by reason of any breach of the duty, incur any liability in
respect of any loss of or damage to property.
(9)In this section —
“highway” means any part of a highway other than a ferry or waterway;
“injury” means anything resulting in death or personal injury,
including any disease and any impairment of physical or mental
condition; and “movable structure” includes any vessel, vehicle or
aircraft.
The answer to the question which had assumed U.S. law is set forth below with the pertinent parts to U.K. law in bold.
END UPDATE
The law varies from state to state.
In every state except Louisiana and almost every territory except Puerto Rico, the starting point of the law on the subject to was English common law as received in the United States.
Louisiana's tort laws are derived from the French civil code as of the time of the Louisiana purchase as amended from time to time by the Louisiana legislature. In Puerto Rico, a commonwealth civil code derived from the Spanish civil code governs. Tort law under civil codes involves a completely different set of doctrines than at common law and are beyond my knowledge. The statutory language generally says something to the effect that "a person at fault is responsible for harm caused" which is interpreted in a variety of ways under different circumstances generally only made clear by legal treatises discussing those provisions and not by the statutes themselves.
The common law rule established three main tiers of liabilities: the highest to invitee (e.g. guests at a hotel) who are owed a duty of extreme care, the intermediate level to licensees (e.g. appliance repairmen) who are owed the general duty to refrain from negligence, and the lowest to trespassers. A few states, such as Colorado, have codified the common law rule.
Generally, at common law, trespassers were subject only to the duty that the property owner not intentionally create deadly traps.
But, the common law evolved over time to create an exception to that rule for "attractive nuisances" that lured people (particularly children) to come onto the property (many cases involved swimming pools and play equipment and cases where children were known to trespass and use the property, e.g., for skateboarding tricks), applying the higher standard for licensees unless affirmative efforts were made to prevent people from entering onto the property. The attractive nuisance exception would almost never apply to a burglar.
Also, sometimes a trespasser does not count as such for liability purposes unless it is clear under the circumstances to a reasonable person that the actions involved are trespassing. For example, someone who crosses an unmarked property line in a forest might not be treated as a trespasser for liability purposes even if they are technically trespassing and could be held liable for doing so. Some trespassers would be treated as licensees in many states unless it was clear under the circumstances (e.g. a fence, no trespassing sign or other circumstances requiring breaking and entering) that the person was a trespasser. Again, this would almost never apply to a home burglar.
Some states have abrogated the common law rule for a rule that applies a negligence standard to all persons on premises, with something of a sliding scale that it not so categorical determining if the property owner is negligent and hence potentially liable. These are the states where liability to a burglar due to unsafe premises might at least go to a jury. The question for the jury would be if the harm was caused by the failure to the owner to act with the care of a reasonable person under all of the relevant circumstances. In these cases, the key question would be whether it was foreseeable that there would be a burglar and that the burglar would be hurt by the conditions of the premises and that the cost of preventing such injuries was not outweighed by the unlikeliness of that happening.
Some states (sometimes overlapping with those who have abrogated the common law categories) have statutes that expressly eliminate liability to people who are harmed while carrying out crimes such as burglary or breaking and entering, usually enacted in the last 40 years as part of a tort reform package of legislation.
BONUS QUESTION: In addition to the usual consideration, the important issue would be sovereign immunity.
Generally, under the common law, the government had not tort liability except in circumstances expressly permitted by statute. So, the question would be whether the relevant governmental liability statute in the jurisdiction within the U.K. that applied allowed a suit on that basis.
I don't personally know what the relevant governmental liability statutes in various parts of the U.K. say, but the relevant laws are discussed as of 2006 in this law review article (closed access with substantial preview).