In text messages seen by the BBC, the prime minister promised to "fix" tax changes the entrepreneur wanted.
Mr Johnson said any PM would have done the same in the circumstances, to secure ventilator supplies.
But Labour leader Sir Keir Starmer said it was part of a pattern of government "sleaze" centred on the prime minister.
Trading verbal blows with Mr Johnson at Prime Minister's Questions, he claimed there was "one rule for those who have the prime minister's phone number and another for everybody else".
The text messages were sent between Sir James and Mr Johnson in March last year, when coronavirus hit the UK.
Sir James wanted to ensure that Dyson workers returning to the UK to help with the pandemic response were not penalised by the tax system.
This happened after the government asked businesses - including Dyson - to help supply more ventilators, amid concern about a shortage of the equipment as coronavirus infections increased.
In the House of Commons, Mr Johnson insisted he had done the "right thing", saying: "I make absolutely no apology at all for shifting heaven and earth and doing everything I possibly could, as I think any prime minister would in those circumstances, to secure ventilators for the people of this country."
But Sir Keir compared the way Mr Johnson responded to Sir James' concerns with the government's treatment of steelworkers, nurses and three million self-employed people who have been left out of coronavirus support schemes.
He claimed there was a "pattern to this government".
"Every day there are new allegations about this Conservative government: dodgy PPE deals; tax breaks for their mates; the health secretary owns shares in a company delivering NHS services," Sir Keir said. "Sleaze, sleaze, sleaze, and it's all on his watch."
Mr Johnson took a swipe at Sir Keir, telling MPs: "Captain Hindsight snipes continually from the sidelines. This government gets on with delivering on the people's priorities."
I understand Number 11 - the chancellor's team - were uneasy about what Sir James Dyson was asking for in his approach to them, and it's suggested they had quite deliberately not responded to his firm's requests before Sir James himself then texted the PM directly about the tax issue.
I'm told Chancellor Rishi Sunak did not and has never had any personal contact with Sir James.
When it comes to publication of texts, the Treasury set a precedent a few weeks ago, when it published Mr Sunak's texts to David Cameron about Greensill.
At PMQs, the prime minister said he would "share all the details with the House".
But one of the big issues with rules about how ministers are meant to behave is the proliferation of politics being done by text and WhatsApp.
Whatever happened in the case between Boris Johnson and Sir James Dyson, the rules contained in the ministerial code don't really cover the reality of how people communicate now.
SNP Westminster leader Ian Blackford called on Mr Johnson to reveal "how many more Covid contracts he personally fixed" and publish all personal exchanges on these contracts.
The prime minister said there was "absolutely nothing to conceal about this" and that he was "happy to share" the details with MPs "as indeed I have shared them with my officials immediately".
BBC political editor Laura Kuenssberg said Mr Johnson's text exchanges with Sir James had been "referenced" in correspondence sent by Sir James's company "as evidence of a guarantee they believed they had been given".
The prime minister's official spokesman said Mr Johnson had abided by the ministerial code, governing conduct in office, and had "informed officials in a timely manner" after his contact with Sir James.
He added that he did not know when the prime minister would publish his exchanges with Sir James.
In March last year, the Department of Health feared the NHS in England could need as many as 20,000 additional ventilators on top of the 5,000 it had - along with an existing 900 to treat children.
The prime minister is understood to have called Sir James on 13 March and asked him to participate.
Dyson answered the call and said it spent £20m on developing its own design - though subsequently the company was not called upon to provide ventilators to the NHS.
But the BBC has discovered that Sir James also raised his concerns with the Treasury, and later the prime minister, about rules that could see staff brought into the UK for the project needing to pay tax.
In text exchanges seen by the BBC, the PM messaged Sir James saying: "[Chancellor] Rishi [Sunak] says it is fixed!! We need you here."
When the businessman sought further reassurance for the tax status of the firm and "senior individuals", Mr Johnson replied: "I am First Lord of the Treasury and you can take it that we are backing you to do what you need."
Two weeks later, Mr Sunak told a group of MPs that the tax status of people who came to the UK to provide specific help during the pandemic would not be affected.
Sir James said he was "hugely proud" of his firm's response in "the midst of a national emergency", and that he would "do the same again if asked".
He said: "When the prime minister rang me to ask Dyson to urgently build ventilators, of course, I said yes.
"Our ventilator cost Dyson £20m, freely given to the national cause, and it is absurd to suggest that the urgent correspondence was anything other than seeking compliance with rules, as 450 Dyson people - in UK and Singapore - worked around the clock, seven days a week to build potentially life-saving equipment at a time of dire need.
"Mercifully, they were not required as medical understanding of the virus evolved. Neither Weybourne (Dyson's holding company) nor Dyson received any benefit from the project; indeed commercial projects were delayed, and Dyson voluntarily covered the £20 million of development costs."
Sir James also said his company had not claimed "one penny" from governments in any jurisdiction in relation to Covid.