Firefighters were called to the property in Ynysfach just before 04:00 GMT.
The blaze had started in rubbish outside the house and spread to the kitchen
The Welsh Ambulance Service said two male casualties were taken to Prince Charles Hospital.

The 26-year-old, who was with juniors Kelty Hearts, has signed for Edinburgh City in League Two.
Thomson pleaded guilty in June 2011 to inappropriate conduct towards two underage girls over the internet.
City noted his court conviction but said on Twitter they believed he deserved a second chance.
"The club acknowledges Craig's previous conviction in 2011 for offences he committed in 2010 and does not condone his behaviour in any way," they said in a statement.
"However, the club's board, management, playing staff and main sponsor collectively believe that Craig has completed his rehabilitation and we look forward to giving him the opportunity to return to playing in the SPFL."
Thomson was loaned to Lithuanian clubs Kaunas and Suduva after being fined and placed on the sex offenders' register for five years but never played for Hearts again.
After leaving Tynecastle officially in 2013, the former Scotland Under-21's potential move to Cyprus was swiftly cut short when prospective club Paphos discovered his conviction.
But he has since played for East of Scotland junior sides Arniston Rangers, Newtongrange Star and Kelty, who won the Super League last season.
Former Hearts manager Jim Jefferies, who is sporting director with Edinburgh City, stated the club would be making no further comment.
Two people have been taken to hospital suffering from the effects of smoke inhalation after a house fire in Merthyr Tydfil.
[NEXT_CONCEPT]
Former Hearts full-back Craig Thomson has returned to Scottish senior football for the first time since he was convicted of a sex offence.