In one of our conversation, you wrote that you are from nepal... So here I will use some hindi language too. Don't confuse from various representations of dharma, dhamma, atta.
Dharma( धर्म ):: This word was already there in India even before buddha. Even Aghoris used to use this word. This also includes the
wrong views of attaining liberation and/or gaining merits through sacrificing ( बलीप्रथा ) animals and humans( नरबली)--even nowdays these are being practiced.
Dharma was/is referred to all the principles that govern this universe.See Hinduism part
Such sets of principles were/are considered to be right view. Eg., dharma of a kshatriya is only to fight&rule, dharma of various castes, dharma of fire is to produce heat, and so on, dharma of deva/ghost/... is to eat material food, and so on...
Note as to how dharma is generalized to meanings of behaviour, duty, karma, requirement_for_satisfaction of celestials,...
Now, buddha arrived::
After attaining enlightenment, having Right view, he sees that dharma of human has nothing to do with caste, satisfaction_dharma of celestial beings has nothing to do with materials,...
So, a new term has been given, simply because it would be too much troublesome to waste time on teaching right_dharma without an appropriate word.
Dhamma:: Set of all the right principles governing universe, so simple.
These principles are also concrete cause they are being told through Right View in righteous way(8 fold Noble path).
Atta:: This is a generalized word for 'self'. It can be used to mean inner-self and outer-self. Atta, when used to indicate seemingly 'I' means 'inner-self', when used for other things means 'outer self', i.e. self of other things.
Sabbe dhamma anatta:: It means that all the right governing principles are not-self(this self is outer-self), means that they don't have any permanence within them.
This statement was specifically given for those people who declared buddha to be God( परमात्मा/parmaatma/eternal-self ) and hence principles given by him as his child( आत्मा ) buddha as vishnu...to remove wrong view among people.
Along with this, dhamma states it's permanence in sense that from infinite past-time, these principles are true&right, at present these are true&right and in infinite future time these will be true&right.
Buddha also states it's permanence as,"Whatever principles have been given were, are and will remain true&right".
So, to avoid any misunderstanding, he simply said, " I have no atta, dhamma also has no atta".
That's it. No confusion.