Does it have to be 512 B nad ahve the signature 05AAH at offset 510 ?
What about on CD Roms and HDDs?

I'm afraid it does. In theory the floppy disk drive controller can be programmed to format the disk with other sizes, but nobody, so far as I know, has ever done it. Nowadays hard disk drives come already formatted with 512 bytes sectors. When they are "formatted" all that happens is that the formatting program checks to make sure all the sectors are readable, and then puts down the data structures used by the operating system to keep track of the files on the disk. CD's likewise come already formatted.