You're essentially asking if it's possible for a human being to be unbiased. The answer is no, it's not. Even in the case of professional manuscript evaluators working for total strangers, there is no such thing as truly unbiased feedback.
But there are ways of improving the situation.
"Beta reader" is an tern that just screams the words "fan fiction". And "fan fiction" is a term that has, for decades, translated to "terrible quality". However, the deluge of terrible self-published fiction has given the lie to that association. It's not fan fiction that's bad, or self-published fiction. It's writing where no genuinely useful feedback been given to the writer, or, worse, the only feedback is from friends and family or internet pals who are afraid to offend the writer. (Crowdsourcing is pretty good for catching typos, but it's not very good at consistency or getting useful, professional feedback.)
The right question:
Can one work on oneself to be able to give a more unbiased feedback to a close relative, friend, wife/husband, etc.?
That's not the right question to be asking. What you really need to decide is whether or not you want to be a beta reader who is one who will give this sort of feedback. You don't need to steel yourself to recognize bad writing so much as be someone who will be willing to tell the writer when they have a serious, deep issue.
Dealing with writers:
If you're a perceptive reader, able to puzzle out what it is that a writer is trying to do, then you're perfectly capable of giving helpful feedback. If you're capable of writing "this would be more effective if you..." rather than "this sucks" in the comments, you're able to give palatable feedback that will help a writer.
But there are times when the only good advice is going to be that the writing just isn't working. And a good test reader needs to be able to say that.
And the very best test readers (or editors) are able to not only say when something simply isn't working. They're also able to give suggestions for how to improve the work. There are times when the writing is bad enough that it's difficult to find those suggestions, but there are always ways to make something better.
There are also times when a writer is touchy, and honest feedback will upset or offend them. To be a truly useful test reader, you need to risk doing these things. Then give them suggestions for fixing the problems. Whether they follow your suggestions is entirely up to them.
And always, always tell a writer when things work well. If you don't do this, they (very correctly) won't ask you for more feedback.
"Give me feedback" is a terrible thing to say. What sort of feedback? What does the writer want you to focus on?
Find out what they expect from you, and give it to them. Both of you will be happier, and more problems will be fixed.
Of couse, identify other areas of improvement as well.
Close relationships and evaluating writing:
Conventional wisdom is that this is always a bad idea. But there are exceptions to everything. Some married couples can tear each others' work to shreds and all is fine. And friendships have probably been sundered over typos. You need to make this call on your own.
If giving feedback to a spouse is going to cause marital difficulties, the choice is clear. There should be no feedback. And bad, pandering feedback is worse than none at all. The same applies to friends and co-workers. If they can't take honest criticism, don't give them any. Or just point out typos.
I ask for feedback on my own writing from people I don't know very well for these reasons. However, I do have a few close friends I can count on for murderously on-target feedback. They know me well and know where I tend to obsess over trivialities, and are good at puzzling out what I meant to say. And I trust their judgment.
This sort of relationship takes time, and is quite rare. But these are also people who know that criticism may hurt me in the short term, but I'll be happier later on having fixed problems. But I'm fairly confident in what I can do, and brutal criticism won't strike at the core of my being. Is the person you want to give feedback to such a person?
So cultivate the sort of relationship, where the writer counts on you for honest feedback. Once you get to this place, you really can tell them "this story is garbage, and here's why."
There are no easy answers to a situation like this. If you decide the relationship can handle serious criticism, and to go ahead with this: Decide what you want the writer-test reader relationship to be, with the writer if at all possible. Clarify expectations. Cultivate that relationship. Repeat. Better writing should result.