FreeDOS assumes a BIOS, and does not work with UEFI
The FreeDOS wiki page wiki.freedos.org/wiki/index.php/UEFI tells us that it does not work:
UEFI is an acronym for Unified Extensible Firmware Interface.
Note that many new (2010 and later) computers boot using UEFI, which
is not compatible with BIOS. FreeDOS assumes a BIOS, and does not work
with UEFI.
Many motherboard manufacturers are replacing BIOS+MBR with UEFI+GPT.
UEFI uses a GPT table instead of the MBR. UEFI handles large-sectored
hard disks. Hard disk manufacturers are already (2010 and later)
coming out with hard disks with large sectors, which BIOS does not
handle (they are hard-coded to 512-byte sectors).
Almost all UEFI systems today (2021) can boot also in BIOS mode alias CSM alias legacy mode. But we can expect that in the future many PC computers will be delivered with UEFI/BIOS systems that boot only in UEFI mode.
A workaround to run FreeDOS would be to install it in a virtual machine and set this virtual machine to boot in BIOS mode alias CSM alias legacy mode. You can use VirtualBox for that purpose. (But you cannot flash the computer's BIOS that way.) There is also DOSBox, an x86 emulator with DOS.
Edit 1:
I found this link, that might be helpful:
wiki.archlinux.org/index.php/Flashing_BIOS_from_Linux
Flashing BIOS from Linux
This article aims on providing information on flashing your system
BIOS under Linux. Most manufacturers provide a Windows executable or a
BIOS executable that can only be run under Windows. However, there are
a few utilities that allow you to upgrade your system BIOS under
Linux. Warning: Flashing motherboard BIOS is a dangerous activity that
can render your motherboard inoperable! While the author of this
article has successfully run this procedure many times, your mileage
may vary. Be careful! You may want to consider updating microcode
instead if it is supported by your system. Note:
...
For users with Dell computers, Dell recommends Linux users flash their BIOS following information located here (in short, put the .EXE
on a USB stick and use the F12 boot menu to access the firmware's
flash utility).
Edit 2:
Flashing BIOS from Windows PE
It is possible to run Windows PE also in UEFI mode. The standard procedure is to use your own or a friend's Windows 10 system to create a Windows PE system in a USB pendrive or CD/DVD disk.
When booted from Windows PE you can flash the BIOS.
According to this link it can be redistributed for non-commercial purposes (so OK to use a Windows PE made in a friend's Windows system).