You would normally have some sort of contact with HMRC before it goes to a debt collection agency.
Not much use with a letter, but this is their advice if someone turns up on your doorstep:
However, when faced with an unknown caller on the doorstep, our customers may still be concerned. To provide a safeguard against bogus callers in these situations, HMRC has introduced a new Field Force Verification Helpline, so that a customer can easily check whether or not a caller on their doorstep claiming to be from HMRC is, in fact, genuine.
To access the helpline, customers should follow these simple steps:
• Ask to see the Collector’s photo ID
• Make a note of the ID number on the photo ID
• call 0300 200 3862
• Provide HMRC with the ID number you’ve noted
Our operators will then be able to confirm to you whether or not your caller is genuinely an HMRC Collector.