A firefighter has died and another has been injured fighting a blaze at a hotel in Cobar in western New South Wales.

Daniel Howard died after a wall collapsed on him as he fought the fire at the New Occidental Hotel on Marshall Street.

He suffered a suspected cardiac arrest, NSW Minister for Emergency Services Stuart Ayres said.

"The officer was taken by ambulance to Dubbo Base Hospital where he was pronounced deceased," Mr Ayres said.

"As a member of Fire and Rescue NSW, this man selflessly dedicated his life to the safety of his community."

Mr Howard's friend, Darran Wells, said Mr Howard was passionate about his family and friends, his town and his rugby club.

"Cobar, being a very small but very close community, will feel this for a long time and I can definitely vouch, he'll never be forgotten," Mr Wells said.

"He was also well-known for his generosity in mountainous amounts towards so many different things and so many different people.

"If he could help out, he would. He never said no to helping."

Fire and Rescue NSW Commissioner Greg Mullins was travelling to the town with senior staff from the organisation's Critical Incident Support Team.

"Today we have lost a dedicated firefighter, committed to protecting his community," he said.

"He lost his life protecting other people in his community and on behalf of all members of Fire and Rescue NSW I extend our deepest sympathies to firefighters, family and friends."

Police said everyone inside the two-storey hotel had been accounted for and the second firefighter was receiving treatment in hospital for a broken arm.

Fire and Rescue NSW spokesman Wayne Phillips said 10 people escaped from the hotel, which caught fire before 8:00am on Sunday.

"When fire crews arrived the fire was already quite large," he said.

"They have fought very bravely to contain the fire but during the fire this morning a wall has collapsed and tragically a firefighter, as a result of that wall collapse, is deceased."