The following page of the Darkest Dungeon 2 guide explains whether you can leave an Expedition and return to the Inn, what are the consequences of quitting an Expedition, whether you can quit a fight, and what does the Abandon Run button do.
The gameplay in Darkest Dungeon 2 is based on 3 elements - resting in the Inn, exploring Regions, and fighting. When you open the main menu, you will see the Abandon Run button.
Using this button will completely exit the current run - you will return to the hero select menu and story progress will be erased. You will also lose all items and Trinkets collected during the game as well as the Mastery Points. Nevertheless, you will still receive Hope points which are for leveling up your Profile (this unlocks new items/heroes). Any unlocked skills that are now available to the heroes will also remain, immediately at the start of the next Expedition.
Unfortunately, in Darkest Dungeon 2, you cannot withdraw from the current Expedition while traveling on the map to move to the Inn right away. Unlike in the first game, you also have no option to leave the fight. If you start a fight, you must finish it - no matter who wins and how many people will die.Of course, if you think that you won't be able to explore any further, you can just press Abandon Run and try again.