For flush fittings (no ceiling rose) the enclosure at the back is sometimes formed by the body of the light fitting, and whatever it is screwed to 'the fabric of the building'. Wall lights are really bad for this, as choc block is often stuffed in an inadequate void.
Ideally a box should be set into the wall or ceiling, particularly if the wall or ceiling is potentially flammable, and I find round dry lining boxes go quite well in the ceiling in these cases. In reality this is often not done by many installers, and the accident rate suggests the risk is small in practice. Similarly the fact that live contacts can be exposed without use of tools by taking the bulb out of most traditional fittings, is clearly not really a problem either, despite sounding horrific when you say it. So in summary not good, but not uncommon, and not life threatening if a little thought is used to avoid the silliest of installations.