Here in the UK there are two meanings for flashing your headlights,one official,the other unofficial.
The official one,as used in our Highway Code(the Bible by which the government expects us to drive safely and on which all tuition is based ) states that "flashing" should only be a means of letting other road users know you are there.Therefore if you flash a friend going the opposite way you could be alerting the police car ahead that you're there and he may well wonder why he is being flashed.Not a good idea!
The unofficial meaning,and this is universally used and understood although the government will not approve it,is a give way signal.That is you will flash someone to let them out,allow them to change laneetc.The unofficial acknowledgement to this,and truck drivers nearly always do it is to flash your left indicator and then your right,
We all understand this.
In Switzerland motor cycle riders will always wave to other motorcyclists,regardless of make of bike.
In rural Ireland the one finger wave (friendly)is often given even though the driver doesn't know you.
They are very friendly folk!