You can put boilers in bathrooms
This. The lasted rented flat I lived in had the boiler in the bathroom. Inspected every year for 6 years I was there and checked a couple of times by British Gas when they were doing metery stuff. No issues whatsoever. I think the main concerns are usually around proer electrical grounding and distance from the bath/shower. Ours was over the bog, one dude just said, "don't lean on it to take a piss if it gets a bit sparky".