Strictly speaking, the island containing England, Scotland, and Wales is Britain (or Great Britain; both are used). The United Kingdom is a country that is not the same area as the island.
The problem, as with many historical names, is that the word Britain and the name United Kingdom are used in multiple ways to mean similar but not exactly the same things. Some people do mean the UK when they say "Britain" or even "Great Britain", and they aren't really wrong. And the reverse is also said: people say UK when they mean Britain or Great Britain. Same thing with "Britain" as a geographic entity (rather thana country): it can mean the main island, or the many islands of the British Isles, or really a lot of things of that general idea.
For me, the UK itself is a specific country which is not a single main island and/or the smaller nearby islands, so I would never expect UK to refer to the main island itself, only. Britain? yes. UK? No. UK is more than the island of Great Britain/Britain. But I don't come from there. It is not actually my decision to make.