Allies captured one from a disabled Uboat.during the war and broke the code.
More than 1, I think. The Brits captured U-559 while the US later captured U-505. There may have been some surface vessels carrying Enigma that got grabbed too.
Poland actually got possession of one. They sent it to England 2 weeks before the war started.