Can somebody who finds one of my documents use its code?
No. The code only points at the document; it does not unlock it. Scanning it opens the document for an account that is already allowed to see it and nobody else — a stranger is told the document is not in their account, the same answer as for a code that does not exist.
From the guide Receipts, Notices & Statements.
Asking for one
Some documents are not produced by an event, so you can ask for them at any time: an annual rent statement for a year, a statement of account over any period, and a rent verification letter for a lender, a landlord reference or a benefits office. Asking twice for the same period gives you the document you already have rather than a second, slightly different one.
Read the whole guide: Receipts, Notices & Statements