While the BEF was a major part of the British army, it was not the full army. The 2nd BEF, which included 1. Armoured Division, Beauman Division, 52. Lowland Division and 1. Canadian Division, collectively known as the 2nd BEF, were evacuated with most of their equipment and in good order in Operation Ariel. About 100 000 second line troops were also evacuated.
Operation Cycle did not go as well, but most of 51. Highland Division and some French troops made it out.
If the Germans attack Dunkirk, lots of the British troops will fight very hard - as they usually did with their backs to the wall - and the German Panzer divisions will be roughed up quite a bit. This might delay Fall Rot enough for the French to put up more resistance and the French government to opt for fighting on from North Africa.
The troops at Dunkirk did not play much part in ww2 until 1942. The forces in the western desert was made up of 7. Armoured (created on spot with assets already in Egypt) and 1. Armoured (not part of Dunkirk) and Czechs, Poles, New Zealanders, Australians, South Africans and Indians, mostly. There were also plenty of 2nd line formations that the British has in Egypt but never used - the East African Division, the Belgian Kongo Brigade, the Arab Legion, the Sudanese Defence Force and so on.
While a loss of the BEF at Dunkirk might butterfly some things, like Operation Compass (however, there's no way the Italians can advance beyond El Alamein), I do not think it will influence the outcome of ww2 that much - the soldiers from the Empire and USA will have to shoulder more duties as there are fewer British soldiers to shoulder the same duties, but I do not think things will be that different.