TL;DR:
For the titular question:
A floppy drive doesn't identify anything at all (some may to track 0). For tracks it steps in or out as much as the controller tells. It also doesn't identify sectors but read the raw magnetic stream. it is the controller that looks for data blocks, picks headers thereof and acts according to whatever address is written there.
For the workings of the programs mentioned:
They simply read the floppy using OS calls to deliver one or more sectors within a track.
Some advanced (modern) can do more like low level reading and measure time to show real distribution.
How do both applications know the start of the first sector and the end of a the last sector of a floppy disk,
By simply reading it?
The shown programs work by reading logical sectors with the usual OS calls. They simply read each sector in ascending order, from 0 to max (as set by the OS) using the OS function to read a sector - the very same way as any other access does.
in order to accurately visualize it on an image (FDM) or progress-like bar (NDD)?
Reading is all done on a logical level and, except for the very last picture, they display only an assumed, logical structure, not a real distribution. These images are abstract representation of the data gathered to make reading easy, not really low level positional information.
When is the disk in the proper direction visualized, assuming sector 1 starts at position twelve-o'clock on the left visualization and on 0% in the second visualization. Or more broadly how does a floppy drive (driver) identify the unique sectors?
Like it is always identified when reading, by it's header?
Also if I understand it correctly the formatting type determines the sector structure so in order to analyse and visualize the bad sectors, firstly the formatting type needs to be determined and understood in order to visualize?
No, it doesn't. At least not for those basic graphics.
Format information is provided by the OS. Neither of the programs bypasses the OS when reading. It's just the high level information presented in a nice circle or sequence of blocks.
Now, of course it's possible to do a more in depth analysis by using direct, low level hardware access. Programms doing so will need their own floppy drivers on modern OS (*1), while on classic DOS they would simply operate FDC and timer direct. This would start by direct reading a track. Either using a read track command and analyse the data stream delivered by the FDC or reading each sector of a track while measuring access time.
Positioning of sectors relative to each other can be calculated from the read data when reading track, or from a timer counting. Relative positioning between tracks can as well be based thereon, as disk rotational speed is constant. At least as long as the drive doesn't stop inbetween :))
Of course it may be useful to determinate the exact speed an individual drive is running at first. This can easy be done by reading the same sector (like the first one) twice and measuring the waiting time between these two reads - better to do that a few times to get a more reliable measurement.
By measuring each access time for each sector on each track a nice picture of the real distribution can be drawn - unlike the abstract ones offered by NDD or FDM.
*1 - Some information could be gathered without a dedicated driver by timing based guessing ... err ... statistics, but this depends quite a lot on OS behaviour.