Rishi Sunak has said he finds it "very upsetting" that his wife has faced criticism over shares she owns in a tech company operating in Russia.
The chancellor compared his feelings to those of film star Will Smith, whose own wife was mocked at the Oscars.
But he joked: "At least I didn't get up and slap anybody, which is good."
Mr Sunak's wife Akshata Murty owns shares thought to be worth more than £400m in Indian firm Infosys, founded by her father, Narayana.
The chancellor has himself come in for several days of criticism over last week's Spring Statement, which opposition parties say did too little to address the spiralling cost of living.
He told the BBC's Newscast podcast: "I think it's totally fine for people to take shots at me. It's fair game. I'm the one sitting here and that's what I signed up for."
But he added: "It's very upsetting and, I think, wrong for people to try and come at my wife, and you know, beyond that actually, with regard to my father-in-law, for whom I have nothing but enormous pride and admiration for everything that he's achieved.
"And no amount of attempted smearing is going to make me change that because he's wonderful and has achieved a huge amount."
Mr Sunak also mentioned England cricket captain Joe Root, whose team lost a Test series to the West Indies at the weekend, and Mr Smith, who slapped comedian Chris Rock in the face when he mocked his wife, Jada Pinkett Smith, over her alopecia at Sunday's Oscars.
He told BBC political editor Laura Kuenssberg: "Someone said, 'Joe Root, Will Smith, and me - not the best of weekends for any of us.'
"But I feel, on reflection, both Will Smith and me having our wives attacked - at least I didn't get up and slap anybody, which is good."
Multinational software giant Infosys has kept what it calls a "small team of employees based out of Russia" following the country's invasion of Ukraine.
Labour and the Lib Dems have said Mr Sunak has questions to answer about whether his family benefits from the shareholding at a time when he is calling for UK businesses to divest from Russia.
Cost of living
UK inflation is surging, on the back rising food and energy prices, with Office for Budget Responsibility predicting that living standards will drop by 2.2% this year - the largest fall since the 1950s.
Labour has urged Mr Sunak to do more to reduce the pressure on households by imposing a windfall tax on profits made by gas and oil firms.
But the chancellor said: "I'm confident in what we've done. I know it's tough for people.
"We're facing a very difficult situation with the price of things going up and I want to do what we can to ameliorate some of that, but I'm also honest with people that we can't ameliorate all of it, sadly."
Mr Sunak added that he did not think increasing government borrowing to give households more help "would be sensible", arguing: "Actually, it has the risk of making the problem worse when you've got inflation and interest rates going up."
He said: "Some of these things are difficult. They're certainly unpopular. But they're responsible and will help us in the long-term and I'm not going to deviate from that just for some short-term popularity gain."
Rishi Sunak's full Newscast interview is available on BBC Sounds.