I have installed windows 10 on UEFI and Ubuntu 19.04 in legacy mode. When pc booting I change between UEFI and Legacy. When the UEFI mode pc boot with windows and legacy mode it will boot ubuntu. Is it fine switching between those tow firmware?
When you start the computer you enter the manufacturer's boot setting by pressing the F2 key. From there on the boot process proceeds like the below diagram. Windows 10 is installed in UEFI mode and Ubuntu 19.04 is installed in legacy mode.
In your Windows 10 / Ubuntu 19.04 dual boot the MBR and EFI boot loader are stored in two separate locations on the hard disk, so in your case I don't see any adverse consequences to selecting the bootloader from UEFI at boot time. In the general case the firmware may be programmed to select only one bootloader in which case the computer can't boot both Windows and Ubuntu if one OS is installed in BIOS mode and the other OS is installed in UEFI mode. Your case is different from the general case because if both OSs are installed in UEFI mode it is not booting the first installed OS.
EFI files are bootloader executables, exist on UEFI (Unified Extensible Firmware Interface) based computer systems, and contain data on how the boot process should proceed. Most of the time, this EFI file is stored on a special EFI system partition. This partition is usually hidden and does not have a drive letter. On a UEFI system with Windows 10 installed the EFI file will be located at the following location on that hidden partition:
64-bit Windows 10:
or 32-bit Windows 10:
Source: What is an EFI File?
The MBR (Master Boot Record) is the first sector of the hard disk.