OK, taking them in reverse order:
We had a head hunting going on and there was a bonus in a person you refer gets hired you receive ~50% of monthly salary as a bonus. I recommended a guy I knew, but HR messed up with scheduling interview and I was the only one available developer at the time he came for interview. I had to interview him and it was awkward. He failed coding test later.
Don't accept. I don't know how your office does interview scheduling, but everywhere I've worked, all Outlook powered offices, I get an electronic meeting invite from the scheduler. Do NOT accept the invite. Write back a response with why. That does require that you pay close attention to invites to make sure that you catch any conflict of interest. It also requires that HR has clear ownership of scheduling.
If they mess up scheduling, they need to be able to take responsibility for un-messing up scheduling. It is far more annoying to have to re-interview because it couldn't be scheduled correctly the first time than it is to have to reschedule the interview.
It's also within your right to insist on 24 hours notice before an interview happens.
If all that fails, and HR is literally grabbing you with the guy standing at the front door, because they have screwed up that badly, my recommendation would be to go to meet your friend (with your incompentent HR rep in tow) and say "Hey I'm really sorry that your interview has been so badly planned, we have no interviewer available due to a scheduling issue in the team. I'm not in a position to interview you, but can I get you a coffee (or lunch!) and would you mind rescheduling? The company will happily cover the cost of your lunch and your travel..." and then make sure the company pays out of HR's budget. Be classy, but don't interview him, and let your manager know so they can make it clear that this process is not acceptable.
If it's a good friend, take him to a nice lunch.
Yeah, you may end up paying for lunch out of your pocket, but this is your friend.
was asked to interview a friend of mine, whom I actually recommended.
Again, don't accept. By "friend", I'm assuming you mean a person that you know outside of the professional sphere (even if you started as colleagues) such that interviewing would be biased, and also not-accepting him might cause harm to your relationship.
I was asked to interview a person I know.
OK, so there's a slippery slope here. I would say that just because you know the person is not a reason to say "no". I have plenty of colleagues who are purely good former colleagues, and the fact that I know them may be a reason not to waste time interviewing (I'd just say "yes" to hiring them, because I know their work) but it's not a reason to abstain from the selection process. Similarly, there are people that I know from casual conversations, but I really haven't delved into their actual work experiences. In these cases I'd go for it and interview them.
When it's a case where you can be sure that your professional judgement won't be clouded by personal feelings, I think it's safe to be part of the process, and realize that in any decent process, your voice will be one of many. The fact that you only "know" someone isn't a real liability.
If you honestly worry that your professional judgement WILL be clouded for ANYONE you know - it may be time to question your professional judgement and how deeply attached you are to people.