Hello, I am a solicitor with 20 years experience. I will try to answer this for you.
The short answer is that he can do this if it is in accordance with the tenancy agreement which will contain provisions about inspection. If he has one of the common standard agreements then he probably can do this. But to be sure you need to check the agreement.
In terms of protecting your own position re the inspection you can take a film or photos, to prevent any false allegations of damage.
Is your tenancy in a guarantee scheme? If so, the deposit is held by the scheme and they will have a dispute resolution scheme.
Ok Good luck and feel free to ask further follow up questions if you need to.
Also I would be grateful if you would please rate my answer.