Rather wild thought.
In 1814/15, Princess Charlotte of Wales got very smitten with one Friedrich, a nephew of the King of Prussia. OTL, her father vetoed the match (possibly though misunderstanding, or else pique at her rejection of his choice, the Prince of Orange) but suppose it went ahead. If Charlotte's death in childbirth is butterflied away, she becomes Queen in 1830, and sometime around the 1860s, her son becomes King Frederick I thus bringing Britain under a branch of the House of Hohenzollern.
No real problem so far, as King Frederick William III left four healthy sons, putting their British cousins a long way down the line. But in the next generation Fred I has only daughters. Being anxious not to let this grand prize pass out of the family, he marries off the eldest to Albrecht, son and namesake of FWIII's youngest boy. Again seemingly safe, as there are three elder brothers between "Bertie" and the Prussian (or by now German) throne.
Then everything goes pearshape. The eldest brother, FWIV, dies childless as OTL But on TTL, the next two, Wilhelm and Karl, also die without male issue. OTL they had just one son each so it's not ASB. There are frantic efforts to avoid the union of crowns, but neither Frederick nor Wilhelm is willing to tamper with the succession. On Wilhelm I's death in 1888, Frederick I's son in law and daughter become Kaiser and Kaiserin. In 1900, Frederick dies and the two countries are ruled by a husband and wife. Five years later, Charlotte II dies suddenly, and the German Crown Prince becomes Albert I of Britain. A few years later he becomes German Emperor as well.
There is much pressure for him to abdicate one throne or the other in favour of a younger son, but he's stubborn. And in the last fifty years, the two countries' armed forces have become very intermingled, with British Army officers being trained in Potsdam, and German Naval ones at Osborne. They don't see any problem about the Union, and will be perfectly loyal to their King in the event of any revolt.
So we've got a situation akin to Keith Laumer's Worlds of the Imperium, but under the Hohenzollerns instead of the Saxe-Coburgs. From there on, we are living in interesting times.