I think saying thank you is more important. Someone does something nice so you say thank you. It may encourage them and you to do more nice things and in turn cause more people to do the same. I like it when people thank me so I thank other people when they do something nice for me. If I do something nice and they ignore me or give me a strange look I would be less likely to do it again.
Usually when someone apologies to me it does not really mean anything to me. It does not trigger an emotional response or anything. So I do not think saying I am sorry would make other people feel better.