With the exception of CDs, DVDs and Blu-Ray discs (collectively called "optical media"), formatting is not a special action, and is fundamentally the same as any other disk operation. Formatting a storage device (whether it's a hard drive (HDD), solid state disk (SSD), or flash drive) just involves regular old reads and writes to the disk.
The only matters of concern are:
- Are you performing a quick format or a full format? A quick format just overwrites the core filesystem data structures with a new filesystem, and usually only involves a few megabytes of writes (compared to many gigabytes or terabytes of total disk space). A full format only writes a small amount of data, but reads from every part of the disk to make sure the disk is OK.
- Usually after you format a disk, if it's your primary storage, you're going to install an operating system on it. This usually causes between 2 and 25 GB of disk writes at first, plus another several gigabytes to install programs and updates.
All this writing of new data (which will vary in quantity depending on what type of format you performed and what you're going to do after you format it) can cause wear on SSDs, and to a lesser degree, the mechanical parts of HDDs. The amount of wear is proportional to the amount of data that is being read/written, with SSDs largely unaffected by reads, but HDDs being affected roughly the same by reads and writes.
I'm not going to delve into the topic of disk endurance and how certain quantities and frequencies of reads and writes affect the endurance (wear level) of different types of disks. This is a very complex topic that is completely independent from the subject of disk formatting.
Just know that the operation of reinstalling Windows on a hard disk is basically doing the same thing to your disk as copying several gigabytes of movies or pictures or music. Just the act of using a computer involves very frequent disk reads and writes.
The only difference is that formatting a disk and then using it often incurs a fairly large amount of reads and writes compared to what a typical user might do in a day.
Analogy: if you normally drive 8 km to work every day in your car, and then take a holiday trip of 200 km, this is fundamentally the same action -- you're just driving further. Formatting causes more wear on your disk, just like driving further causes more wear on your car.
If you want to know how reading and writing data impacts the endurance of your particular type of disk, you can either ask a new question, or search for existing questions (or use Google) to find this information.