Of course you can act against your own interest! Go ahead, shoot yourself
. Tell me that isn't against your own interests.
What Error404 is referring to is this:
It can be argued that it is impossible to perform a selfless good deed. From this point of view, if you do something "to be nice", it would only be to satisfy your own ego. This can be completely unconscious, i.e. you might not be aware of it.
Another way to see it, is that by being nice to others, you are part of creating a society where people will be nice to you. Thus, you are receiving reward for your good deeds in the long run, even if for example giving to charity seems like a selfless act at the time.