At least for where I am in the US, that's basically how my mail-in ballot worked for last fall's election.
The completed ballot goes into an opaque sleeve devoid of identifying information, which then goes inside of an envelope. The envelope has an extra "flap" where you put your information and signature, and then it seals onto the envelope.
When processed, the flaps have perforations that can be physically separated from the rest of the envelope and validated and retained for audit purposes, and later on the collection of sealed envelopes can be opened and the ballots counted without having any attached personal information.
The completed ballot goes into an opaque sleeve devoid of identifying information, which then goes inside of an envelope. The envelope has an extra "flap" where you put your information and signature, and then it seals onto the envelope.
When processed, the flaps have perforations that can be physically separated from the rest of the envelope and validated and retained for audit purposes, and later on the collection of sealed envelopes can be opened and the ballots counted without having any attached personal information.