David Davis, the former shadow home secretary, described the airline's refusal to allow Miss Eweida to wear her cross as a "disgraceful piece of political correctness" and asked the Prime Minister why the Government was opposing her appeal.
He told the Commons that Miss Eweida was appearing before the European Court in September to complain that there were no protections under United Kingdom law for workers who wore religious symbols.
Saying she wore the crucifix "as a mark of her Christianity," Mr Davis went on: "The behaviour of British Airways in this was a disgraceful piece of political correctness, so I was surprised to see the Government is resisting Miss Eweida's appeal.
"I cannot believe the Government is supporting the suppression of religious freedom in the workplace, so what are we going to do in this case?"
In response, Mr Cameron said he that he was fully supportive of employees' right to wear religious symbols at work, adding: "I think it is an absolutely vital freedom."
He went on: "What we will do is that if it turns out that the law has the intention [of banning the display of religious symbols in the workplace], as has come out in this case, then we will change the law and make clear that people can wear religious symbols at work."
The Prime Minister joked that while he did not always side with Mr Davis – his rival for the 2005 Tory leadership contest – he "wholeheartedly agreed" with him over the BA case.
Miss Eweida, 59, a Pentecostal Christian from Twickenham, south-west London, was sent home from her job at Heathrow in 2006 when she refused to remove her crucifix or accept a non-uniformed job.
She lost an industrial tribunal, which ruled that she had not suffered religious discrimination. Mrs Eweida had argued that the airline was discriminating against her as a Christian because Sikh employees were permitted to wear turbans and Muslims could work in hijab head coverings.
But BA said that the wearing of a cross was not a "requirement" of her faith, unlike the turban and hijab. BA has since changed its policy to allow the wearing of crosses and other religious symbols.
Miss Eweida's has been joined in her legal battle by Shirley Chaplin, a nurse from from Exeter, who was told by her employer, The Royal Devon and Exeter Foundation NHS Trust, to remove a necklace on which she had hung a cross.
It is the first time that Mr Cameron has explicitly promised to change the law in the event that the two women lose their case.
Vince Cable, the Business Secretary who is Miss Eweida's constituency MP, welcomed the Prime Minister's words. He had previously written to Theresa May, the Home Secretary, asking for a change in the law and was told this was impossible.
He said: "As her local MP, I've supported Nadia's right to wear a cross throughout her campaign. I wrote to the Home Secretary eighteen months ago urging her change the law.
"So I am delighted by the Prime Minister's announcement today that the law will be changed to allow people of all religious faiths to be able to wear symbols of their religion."
Mr Cameron's announcement means that Christians and other people of faith will be given formal legal protection to wear religious symbols at work regardless of the outcome of the European Court case.
If Miss Eweida and Mrs Chaplin are successful, then no changes to the law will be necessary because the case will form a legal precedent.
The loss of the case would mean that the Government would be expected to bring forth legislation providing protection for religious workers as soon as the parliamentary timetable allowed.