elf is the compiled program (the execution, like the ".exe" in windows), it's in a "raw" binary executable readable by PowerPC processors.
but it's very big sometime. for example, USBLoaderGX elf is 20MB.
You can compress the the elf to dol, which is another executable format readable by Dolphin (Gamecube, and Wii kept this format too).
Compressing it goes from 20Mb to 4Mb.
It's exactly the same program, just two different way to write it. The Wii can read both.
I think on mini (ARM without IOS loaded) it needs to be elf format (the HBC hackmii installer is in elf)
the elf format is also required to debug, as it contains information on the functions and the sources.
when the program crashes, you get a code dump with numbers, these numbers correspond to location inside the elf which give the location where the sources has a bug.
So, dol and elf are often provided at the same time, one dol for the user, one elf for the debugger in case the developer need to debug that version.
You can use the elf only, but it's bigger. just keep the boot.dol as a final user.