In other words, does defragmentation have to be done on each OS separately?
In a multi-boot setup, does defragmenting from one OS affect the whole drive, or only its partition?
Defragmentation is per-filesystem action. E.g. if you defragmented your C: drive in OS "A", and that drive is shown as, say, D: in your some other OS "B", you don't need to defragment it again.
However, certain defragmentation utilities rearrange files on disk for faster access. E.g. frequently-accessed files that are used together are put close one to another on disk for faster access. Naturally, these statistics are kept per-OS, so you need to defragment filesystems where such things are taken into an account in the OS that keeps these statistics. E.g. if you're deframenting system drive of some OS, do it in the same OS.
Given that most modern OSes either defragment their filesystems automatically, or do not need defragmentation at all, I agrue that you only need to keep your filesystems "not full", e.g. with about 20% free space available, and you don't need to defragment at all.