Conor McGregor is confident that Anthony Joshua can recover from the setback of losing his heavyweight world title fight to Daniel Dubois.