Yes, of course you can attend a job interview.
Indeed, the HR department at your present employer would probably welcome the idea. However sympathetic they might appear when someone is off with a long-term problem (whether that be stress, cancer, caring for a dying relative or whatever), the reality is that having staff off work is simply a pain-in-the-@rse for them and they'd much rather be told that the employee has quit their job, leaving them free to find someone else. So, in their eyes, anything that increases the chances of you resigning your post is bound to be a good thing.