A system can have a UEFI firmware and still boot OS in legacy BIOS mode. In that situation there is no way for the booted OS to determine if the hardware is actually capable of UEFI, because BIOS isn't forward compatible with UEFI.
You can still look at firmware interface if anything is related to UEFI, but that is vendor specific and inconsistent. So there is also no definite answer from that side.
The canonical method to prove your x86(_64) kernel is booted from UEFI:
$ dmesg | grep 'EFI v'
[ 0.000000] efi: EFI v2.31 by EDK II
The kernel will print such message at the main entry point of EFI boot. The kernel is booted with UEFI if and only if such message exists.
Other informative stuff:
$ dmesg | grep 'efi: mem'
[ 0.000000] efi: mem00: type=7, attr=0xf, range=[0x0000000000000000-0x00000000000a0000) (0MB)
This is the memory map passed from EFI firmware to the kernel.
$ ls -F /sys/firmware/efi
efivars/ systab vars/
These are kernel ABI's related to EFI.
efivars (3.8+) and
vars are kernel ABI to the EFI NVRAM so you can change boot options with them.
But lack of these clues does not prove the system is BIOS only.
Empirically, recent laptops all have UEFI firmware. Latest servers are migrating to UEFI firmware.
The author of rEFInd has a more thorough explanation. Steps are the same.
Also, Firmware Test Suite from Ubuntu might detect whether your UEFI firmware has a compatibility feature for legacy BIOS. Although it doesn't solve the problem of detecting UEFI capable firmware booting in BIOS mode.