Does it contain the first sector of the hard disk? Sorry for the naive question
It depends on which one you are talking talking about.
A floppy disk contains a boot sector at the very beginning of it which in addition to some meta-information about the disk, also contains some (very) basic boot code that looks for an OS loader file on the disk and passes control to that (or prints an error message if it can’t find one). Some boot-sectors are designed for a specific OS while others can detect boot-loaders for multiple operating-systems; it depends on who wrote it to the disk.
Hard-drives are pretty much exactly the same as floppies (a boot sector containing code to load a file and pass control), albeit with slightly different structures.
A bootable CDROM actually contains an image of floppy disk. If you examine a CD image in a program such as ISOBuster, you can see and extract the floppy image which you can then view and manipulate with a program such as WinImage as seen below.
As for bootable flash-drives, well there is no official standard for those. Instead, what happens is that the motherboards that support booting flash-drives do so by emulating either a floppy, a CD, or a hard-drive (you may be able to control which by adjusting a setting in the BIOS). As such, the requirements of making it bootable depend on what the system is configured to emulate (that is, you need to rewrite the drive’s boot sector if you change the emulation mode).