Israel Folau’s potential challenge to his sacking could turn on whether his conduct occurred in New South Wales, a legal expert has said.

On Wednesday, the Wallabies star confirmed he would contest Rugby Australia’s ruling that he committed a “high-level” breach of the player’s code of conduct by posting on Instagram that “hell awaits” homosexuals.

The sports body announced last week they intended to terminate Folau’s $4m contract due to the breach. Folau’s appeal – solely on the code of conduct issue – will be heard by a three-person committee after Easter.

The panel will rule on whether Folau’s post breached the code. If it finds that it did, Folau may challenge in court whether that warrants the termination of his contract – and also whether the termination constituted discrimination against religious belief.

However, a legal expert has warned this avenue may not be open to the player since NSW has no statutory protection for religious discrimination.

Amy Zhang, senior associate at Harmer’s Workplace Lawyers, said a broad range of employment law factors were raised by the Folau case, of which religious discrimination was one.

Before any discrimination claim, the law must consider whether Folau’s contract was terminated lawfully by Rugby Australia.

Zhang told Guardian Australia there were two grounds Rugby Australia could argue: that Folau’s contract contained a clause to obey the code of conduct, and that he failed to obey a direction from his employer.

Despite reports that Folau’s contract did not explicitly contain a clause about social media, under current employment law, a code of conduct can become part of a contract (known as incorporation).

For example, the contract could contain a clause that employees are “bound by a code of conduct”.

This would depend on the exact wording of the contract, which is unknown, Zhang said.

“Depending on the wording of the contract – the document may be incorporated into the employment contract either expressly or implicitly. If it is incorporated, it would be a breach of his employment contract and would be a valid dismissal.”

But even if it was not incorporated, Folau’s alleged breach of the code could still constitute dismissal.

“In a lot of employment contracts these days, the relevant clause is expressed to say that the code of conduct is not expressly a part of the contract – but that the employee still has to comply with the code of conduct, and the employer can dismiss them if they don’t.

“Those are pretty common these days. There are a number of cases out there where social media use outside of the workplace is valid dismissal – at the end of the day it’s all about whether there is sufficient connection to the workplace context.”

Folau could also be terminated for failing to obey his employer’s orders not to make such posts. Under employment law, employees have a duty to comply with their employer’s “lawful or reasonable direction”.

On Monday, Rugby Australia’s chief executive, Raelene Castle, said in a statement Folau had been “warned formally and repeatedly”.

“At its core, this is an issue of the responsibilities an employee owes to their employer and the commitments they make … It was made clear to him that any social media posts or commentary that is in any way disrespectful to people because of their sexuality will result in disciplinary action.”

If this was found to be a “lawful and reasonable direction”, then that could be grounds for lawful termination, Zhang said.

However, even if Folau’s contract is found to be lawfully terminated under the terms of the contract, the rugby player could challenge it on the basis of other protections he has under legislation.

“You have the contract of employment but you also have overriding statutory rights and obligations,” Zhang said.

“The employment contract can’t exclude rights and obligations you have under statute. For example, anti-discrimination law or the entitlements under the Fair Work Act.

“[But] the issue with discrimination on the basis of religion is that it is only unlawful in certain states. It is not unlawful in NSW. Thus it depends on the governing law of the contract.”

Zhang said any legal action by Folau could take years.

“It depends which kind of claim he wants to commence. If it is religious discrimination he would have to lodge a complaint with the relevant state or territory human rights commission, and would be heard in the state or territory tribunal. Or file a claim with the Fair Work Commission and progress into the federal courts. That could take two years.

“If going for a simple breach of contract he could go to the federal court or the relevant district or state court. It’s a one or two year process”.