Yes a virus can infect your BIOS.
However, not being allowed to format the drive can be caused by many other things. (Incorrect placement on the IDE cable, incorrect jumper settings, etc.) I even had a computer that wouldn't let me format the drive due to bad memory!
Try to flash your BIOS.