That's what we used to do pre Brexit - the Dublin convention allowed return to the EU country that asylum seekers had left from; that's why so few came here pre Brexit, it was a waste of time and money paying smugglers to get them to the UK only to be given a cup of tea and then sent straight back.
A bit of a myth, it's believed the number of people who've arrived in boats now exceeds 100,000 and the grand total of people returned under the Dublin Agreement was only 209 (far more have drowned attempting the crossing, than were ever returned).