"Dry run" comes from theatre rehearsals without costumes and from chemistry experiments without solvent; the software sense extends the metaphor of testing without the full conditions.
In theatre, a dry run (or dry tech) is a rehearsal without costumes, without full makeup, without the full set. The actors run their lines and their blocking, but the expensive parts of the production are not yet in play. The purpose is to check timing and staging before the dress rehearsal, where the real thing happens with all the consequences.
In chemistry, a dry run is an experiment run without the solvent that will be used in the real reaction, to test a procedure's steps. The metaphor crossed to engineering, where a dry run means a test execution with the expensive or irreversible parts disabled.
Software adopted it in the 1970s with make -n, formalized it in the 1980s and 1990s with rsync --dry-run and similar flags, and made it central to modern infrastructure-as-code: terraform plan is a dry run made into a product feature.
A dry run is a rehearsal of a process that shows what the process would do if you let it happen, without letting it happen.
— Adapted from rsync documentation, 1996