Is it correct to say that dhammakaya (the sum of all Buddha's teachings) is a synonym of 'the real nature of reality'?
I would say no, not a synonym, but related. The Dharmakaya (in Sanskrit) is the Truth Body of Buddha. I believe it has the most significance in Mahayana Buddhism where it refers to the purified very subtle body which has the nature of bliss and is mixed inseparably with emptiness. The real nature of reality is that phenomena lack, or are empty of, true, independent existence.