What was the last action involving a foreign invading force to take place on mainland Great Britain?
The Battle of Graveney Marsh took place in 1940. On 27 September, RAF fighter planes attacked what they recognized as a new variant of Junkers 88 over Faversham. An order had been issued to them to capture one such aircraft intact if possible. One of the bomber's engines had already been damaged by anti-aircraft fire during a raid on London and the Spitfires were able to destroy its remaining engine, forcing the pilot to make a crash landing on Graveney Marsh. When the London Irish Rifles arrived at the scene from their billet at the Sportsman Inn in nearby Seasalter, the four German crew members had unexpectedly armed themselves with machine guns from the aircraft and a submachine gun. After a heavy exchange of gunfire, during which one German airman was shot in the foot, the Germans surrendered to their opponents and were taken prisoner.
The Battle of Hastings (1066) is the one that many remember from their early history lessons -- when William of Normandy invaded. The Battle of Sandwich (1460) and the Battle of Dungeness (1652) were naval battles -- so not on mainland Great Britain.