This situation can be a bit of a conundrum if you haven’t dealt with it.
Let’s say you review a manuscript for the Journal of Scientific Stuff. Ultimately, that paper ends up getting rejected by JSS. Some time goes past, and you are asked to review what appears to be the same manuscript, by the editor of Proceedings of Scientific Stuff.
What to do?
Here’s what I prefer: Before saying “yes” or “no,” just write back to the editor of PSS, and let them know that you recently reviewed an earlier version of the paper for another journal. Ask them what they’d like you to do.
As an editor, I ask the reviewer to have a look at the manuscript, and if it’s entirely the same as before, I ask them to just send me the same review they submitted before. If the manuscript is different, then I ask them to provide a new review for PSS, in which at their discretion they can mention that they’ve reviewed an earlier version.
I think some reviewers think this isn’t fair to the authors, because this is arguably “double jeopardy” — perhaps a manuscript shouldn’t be put on trial twice with the same reviewer a different journal? But I don’t see it that way, because I don’t see the editorial process as a trial. Reviewers do not have the power to reject or accept papers — reviews are there to advise the editor. The editor should be qualified to determine whether any concerns of a reviewer are substantial or legitimate enough to prevent publication in their journal, and that process can’t be improved by the subtraction of information about the manuscript.
If the editor is not aware that the manuscript is essentially getting the same review from two different journals, this might get into “double jeopardy” territory. This piece of information is important for making a decision in the appropriate context.
Authors who work their way down the tiers without taking the remarks of reviewers to heart are more likely to get stung by ignoring reviews while they are reformatting their references. In our peer review system, this might be more of a feature than a bug.
Have you had different experiences, or do you handle these situations differently?