The highway code states that the only meaning we can attribute to someone flashing their headlights is that they are merely letting you know that they are there. As with sounding the horn, flashing headlights indicates presence and nothing more.
Meanwhile, back in the real world, flashing headlights can mean any number of things in different situations:
If, for example, you are in the right hand lane of a dual carriageway, overtaking the vehicle to your left in your own sweet time, and someone drives up behind you and flashes their headlights, they are not merely saying ,"Not sure if you've noticed, but I'm right behind you." The chances are that you have already noticed that they are right behind you and you understand perfectly what they are really saying, which is, "GET OUT OF MY WAY NOW!". They may also be saying "I'm bigger/faster/richer/posher/more glamorous/more daring/more important than you" and the chances are you understand that too.
Another example is when you are waiting to turn right across a stream of traffic and one of that stream flashes their headlights. You know straight away that they are inviting you to cross their path. In fact, if they did not flash their headlights you might think they were slowing to look at a house number, to change a cd, to pick up the lit cigarette that they had just dropped onto the carpet. If you do not move when they flash their headlights, the chances are they will shout from the auditory equivalent of a bullet proof pope mobile, "What are you waiting for? A written invitation?".
Fair enough, there are situations when flashing can be ambiguous. In a situation where a residential street has cars parked on both sides leaving only enough room for one car to pass between them, if someone flashes at you, it is possible they are flashing at someone else exiting a drive that you haven't seen, so it is always worth having a good look before acting on a flash.
But essentially, not only does flashing have a huge variety of meanings in different situations, we generally understand what those meanings are.