Generally speaking, when HMRC want to visit a taxpayer they do so by appointment, but they do have the power to make unannounced visits. Having HMRC turn up on your doorstep is a daunting prospect.
But there are some points to bear in mind:
A taxpayer is entitled to not allow HMRC onto the premises until their accountant arrives (people should not be intimidated as they have rights which HMRC must tell them about).
HMRC must produce a “Notice of Inspection”, if they do not their visit has not been approved and they should be denied entry. The notice must specify the officer(s) involved in the visit and access should be denied to any officers not named in the notice (for which there is no penalty). If they are denied access they can (and probably will) apply to a tribunal for authority. If the notice has been issued by a tribunal and access is still denied to the named officers, there is a penalty of £300 with no right of appeal – So check carefully the names on the notice and who it has been issued by.
If you have the misfortune to have an unannounced visit read all the papers HMRC give you and call your accountant before allowing them access.