There is a set of commands for flashing the bios. This set of commands is deliberately complicated (so that nothing does it by accident), and different on different motherboards (to reduce the probability that you will flash it with the wrong one).

However, if a virus knows the right commands for the specific motherboard, it can reflash the bios which in some cases renders the machine entirely unusable (for ever)

As others have noted, an example of one which did this was the "Chernobyl" virus. At our company, 2 machines were fried by it (and several others had their hard discs wiped)

Some motherboards have a low-level reflash procedure which allows the bios to be reflashed without being able to boot (You hold a key down on the keyboard, having inserted a specially formatted floppy). This recovers a fried bios.