Floppydrives are that stupid things that an XT can not see a difference between a DD and HD drive, and not differentiate between 3.5 and 5.25 inch. It will work, but some cases only as long as you read/write these disks only in that computer.
So if you connect a 80 tracks drive to an XT and does not tell that it is a 80 tracks drive, it will do single step and uses only the first 40 tracks of the disk, with the half width of gap between two tracks like a 40 tracks drive does. This is not compatible to a real 40 tracks drive. (When writing 40 tracks disks with a real 80 tracks drive, the computer must know to do "double step", some drives also have a jumper for double step which has to be set depending on the type of floppydisk you want to write, if the computer does not know about double step 40 tracks)
If you connect a HD drive to a computer that only supports DD, then only DD mode of the drive is used. 3.5 inch is a bit special, as these drives and HD disks have an extra hole to detect HD mode. So the HD drive with a HD disk internally switches to HD mode, but computer still writes in DD data rate. The result is a highly magnetified written track in SD/DD data rate (9 instead of 18 sectors). DD drives will not properly read that strong signal.
If you connect a 5.25 inch 80 tracks drive to a computer which has been setup for 3.5 inch drive, it will work, the computer will not see any difference. Maybe step rate is to slow for old 5.25 inch drives, so they may not move the tracks reliable. For some systems there are tools to set the steprate from 3 to 6 ms, so that is fixable (example: Atari ST).
If you connect a 40 tracks drive to a computer which is setup to 80 tracks drive, it will format up to 40 tracks correctly, but then clonk and failure on track 41.
If you connect a single sided floppy drive to a computer setup for double side, you still can write/format single sided disks with it, but double side will fail.
If you connect a double sided floppy drive to a computer configured for single side operation, you will not be able to access 2nd side of double sided diskettes.