Now that many computers use UEFI instead of BIOS to boot the computer, and UEFI instructions are usually stored in a hidden hard disk partition, does this mean the newest computers do not need to have ROM, which is used to store BIOS program in the old days? Or, was ROM unnecessary long ago even before UEFI existed, as BIOS program and settings were stored in flash memory (so as to store the changes in settings by user)?
Yes, or maybe no, depending on your definitions. Commonly some small 8-pin SPI NOR-Flash ROM is used, for example my slightly older motherboard has a W25Q64FV. This replaces the older non-flash based EEPROM technology since Flash is cheaper, but it fills the same role, and often the flash versions are still called EEPROM. Since it's Flash memory, you could call that "not ROM", if your definition of ROM excludes Flash.
An other problem with relying on a disk is that a disk cannot come pre-programmed correctly. It needs to contain code specific for the motherboard, and be pre-loaded with microcode for the various diffent CPU models supported by that motherboard (which is why recently AMD motherboard manufacturers had some trouble). A disk does not know which motherboard it ends up in, so it cannot fill this role.
Reason it out:
a) Disk-access is way too complicated a process to hard-wire into the CPU. Not to mention that disks from different manufacturers will have different procedures for disk-access, so there is no point in hard-wiring it in advance anyway (what happens to your CPU chip sailes if the disk manufacturer goes out of business?).
b) Therefore the machine must run a program to access the UEFI instructions, and indeed must run a program to perform any disk-access - including the very first access.
c) The program run which performs the very first disk-access obviously cannot itself have been read from the disk.
Conclusion: Yes, machines still need ROM.
Consider a very common modern computer, an iPhone. The ROM needs to be capable of downloading at least the first parts of the operating system and perform cryptographical checks that the downloaded code is genuine and not forged, and then write it to permanent memory in encrypted form. That thakes quite a bit of code.