BIARRITZ, France—British Prime Minister Boris Johnson said he felt more optimistic about achieving a Brexit deal and not crashing out of the European Union after spending most of the past week touring Europe, meeting leaders and pitching his proposals to alter terms of the divorce agreement.

With the clock ticking down to the scheduled departure date on Oct. 31, Mr. Johnson is trying to sell an alternative to a central plank of the current deal, aimed at avoiding a hard border on the island of Ireland.

EU...