Hungary could learn from Poland on fighting corruption and restoring ties with Europe, new Hungarian Prime Minister Peter Magyar says.