The generally accepted and followed electrical code in Britain is the I.E.E. Wiring Regulations, published and periodically revised by the the Institution of Electrical Engineers. The first edition was way back in 1882, under the title "Rules & Regulations for the Prevention of Fire Risks arising from Electric Lighting." Catchy, huh?
After several title changes, by the 1920s the name had settled to "Regulations for the Electrical Equipment of Buildings," which is how it remained until recent times (although obviously with many revisions to the actual content over the years). The title has now been simplified to "Regulations for Electrical Installations" and also incorporated into British Standards as BS7671 by the British Standards Institute.
However, despite the rather official-sounding title these "regulations" never had any legal status. They became the
de facto industry standard in the U.K. and are thus followed for most professional electrical installations, except where some specialized requirement might dictate otherwise, but they were (and as far as private dwellings in England are concerned, still are) merely
recommendations by the I.E.E. as to best practice. It is these widely followed -- but not obligatory -- rules which have for decades "banned" sockets in bathrooms (with an exception for special shaver outlets).
If you discuss this with anyone in the trade, you will probably hear about recent changes to the law and "Part P."
The actual legislation affecting houses in England comes in the form of the Building Regulations, which are divided into different sections, each covering some aspect of the construction: Part A is basic structure, part F covers ventilation, part H is drainage and waste, etc. Prior to January 2005 the building regulations contained absolutely nothing about electrical systems, so legally you could do anything you liked with your own internal wiring.
Part P was added to the building regs. in January 2005 to bring wiring within their scope for the first time ever, but there is still no legal obligation to follow the I.E.E. Wiring Regulations. Part P stipulates only vague requirements that wiring should be reasonably safe to provide protection against fire and electric shock, that information necessary to maintain the system properly must be provided, and so on. It also introduced a requirement to notify the local building control department and pay the appropriate fees when carrying out certain electrical works, unless such work is completed by an accredited member of a recognized trade scheme. This is line with other sections of the building regs. which allow certain works to go unreported but require notification and inspection of more major changes.
So there you have it: Despite the recent changes and despite the fact that the I.E.E. rules are widely followed by the trade here, if you want to fit an outlet in your bathroom, then legally nobody can stop you. Finding a "traditional" electrician willing to do the job is another matter, since most who have only ever worked in Britain and are only familiar with the British "code" have the "no sockets" idea so entrenched that there's no way they would do it.
NOTE: These comments refer to private dwellings in England & Wales only. The Electricity At Work Regulations passed into law a few years ago makes compliance with the I.E.E. Wiring Regs. compulsory now for commercial buildings, and north of the border the Scottish Building Regulations have referenced them for private homes as well for a good many years.