Firstly with MS-DOS, only versions 6.00 and above come with DEFRAG.EXE.
I believe that IBM PC DOS 6.1 and up also include DEFRAG.EXE.
DR-DOS, OpenDos and Novell DOS all have DISKOPT.EXE (not sure which versions).
As for other DOS's I don't know.
I highly recommend that you make a boot disk which only contains the system
files and defragmenting utility (plus empty CONFIG.SYS and AUTOEXEC.BAT files).
That way you will be sure that there are no TSR's running, these could
potentially write to disk during the defragmenting process and you don't want
that to happen.
If you want to boot from your HDD make you that you skip the start-up files.
Basically you now only have to run the relevant utility and away you
go, they all have GUI's available.