YABU
I have to say that I am a bit puzzled by this- no, you as an employee can not unilaterally decide to work from home without your employers agreement. You can ask about it/try to negotiate, but you can’t just decide not to without consequences.
If your employers have requested you attend work in person, then you need to either go to work as requested, self-certificate as medically unfit to work (if applicable) and thereafter provide medical certificates as appropriate (again if applicable) or accept the consequences of not attending your workplace to undertake your employment. I imagine that would involve a disciplinary process which may end up in you losing your job. Or you could either resign and look for an alternative job which is fully wfh or resign once/if you secure that post.
The “work from home if you can” is guidance, not legislation. This is not a full lockdown with hard and fast rules, as before. If your employer feels staff need to be at work to do their jobs properly, then I think you should attend (unless there is a specific, very good reason why not- ‘I don’t want to/I’m a bit worried” is not really in that category
The only way you could, perhaps, get round it is if your workplace is in breach of health and safety rules (not rules you would like/think are right, they would need to be breaching regulations).
It might be worth contacting your line manager to see if there is some flexibility on wfh (perhaps being able to work from home part-time, for instance). You may be turned down, but it could be worthwhile asking.
I am a bit fed up of being told that people do “just as well” when wfh, that it is just as efficient etc. From a client and customer POV, I am afraid it isn’t always the case. I was told that wfh was just as efficient and sometimes even more productive by an acquaintance who works for a firm that we deal with, for instance- it might Be true for her individual role (I have my doubts) but it is simply not true from the overall experience we have had as clients (errors, delays, more complex things are taking far longer to sort out than they used to, for example). We are going to be looking elsewhere. Of course, it may well be working well for some companies (for now at least) and if that is the case- great- and I imagine that they will carry on doing so (at least part-time wfh, for instance). But it may be that your employer feels being in the office is better for good reasons. You won’t know if you don’t ask.