It is good of him to apologize. (People think that he did a good thing.)
It is good for him to apologize. (It is in his best interest to apologize)
With respect to the second sentence only "for" seems to work. The use of "of" does not sound correct to me....but I cannot explain why.
It is impossible for him to apologize. (he cannot apologize for some reason)
Student or Learner