Usually, this would not be permitted by the airline. First officers (FOs) are trained to fly from the right-hand side and captains are usually only trained to fly from the left-hand side. The captain may previously have been an FO on this aircraft type (possibly long ago), but could also have become a captain on another type and then transitioned, so they may have no experience flying this type from the right.
The only exception here is a line training captain. These captains are specifically trained to fly from both sides because they also do line checks of other captains (and therefore have to sit on the right during such checks). But even then, the FO would not be trained to fly (or even just monitor) from the left-hand seat. Therefore, for normal operations the answer is clearly no.
However, you are asking about an emergency. If the captain thinks the only way to safely land the plane is to switch seats, then they are allowed to do it. This kind of discretion is typically allowed in an emergency, e.g. in Europe:
NCO.GEN.105 Pilot-in-command responsibilities and authority
(e) The pilot-in-command shall, in an emergency situation that requires immediate decision and action, take any action he/she considers necessary under the circumstances in accordance with 7.d of Annex IV to Regulation (EC) No 216/2008. In such cases he/she may deviate from rules, operational procedures and methods in the interest of safety.
(EASA Easy Access Rules for Air Operations)
Whether switching seats is actually helpful in the situation you described really depends on the details of the situation. How experienced is the captain flying from the right-hand side? If they have never flown this type from the right, I doubt switching sides would improve safety. How much experience does the FO have? If the captain trusts the FO to do the landing, despite flying into a captain-only airport, it might be better to let the FO fly.