The colonial policy of the British Empire was willing, though on a selective basis, to grant far-reaching autonomy to many of its colonies. Starting from the 19th century, many territories were allowed to elect their own legislatures, with a local Prime Minister responsible to that legislature, and the power to run their own affairs, while matters affecting the empire as a whole continued to be handled by the British Parliament in London. Those possessions with particularly far-reaching autonomy would later develop into the dominions and subsequently the Commonwealth realms such as Canada, Australia, or New Zealand, which are de facto independent but still share their monarchy with the UK, with which they stand on equal footing within the Commonwealth.
That set-up is, conceptually, not all that far away from a British Empire that takes the form of an American-style federation, with individual component realms - including the UK itself - handling their own affairs locally via an elected local legislature, and matters affecting the Empire as a whole, such as defence, decided by an Imperial Parliament elected by the population of the Empire, analogous to the U.S. Congress.
This never happened. Instead, the British Empire fell apart, and the dominions took their foreign and defence policy into their own hands, though they would still regard themselves as Britain’s allies. But was a federalisation of the Empire, turning it into a global federated state, ever seriously considered?