Dialog initially sets the local value of $Line to be equal to its global value. This means that the numbering of input and output lines in the dialog follows the sequence outside the dialog. When the dialog is exited, however, the numbering reverts to the sequence that would be followed if there had been no dialog.
Any local value assigned to $Epilog is evaluated when the dialog is exited.
The main loop within a dialog uses global variables such as $Pre and $Post.
The option DialogSymbols sets up local values for variables within the dialog. DialogSymbols defines initial values for the variables.
The option DialogProlog:>expr specifies an expression to evaluate before starting the dialog.
Dialog first localizes variables, then evaluates any expression specified by DialogProlog, then evaluates any argument you have given for Dialog.