Defensive walls are built on solid foundations. There is no engineering constraints on thickness beyond the availability of materials and the foundation to support the weight.
Height is the real limiter, but if you look at the large pyramids in Eqypt, you can basically have as high as you want as well so long as it slopes from the base rather then being vertical. I would think a wall 3/4's as high as the big Pyramid would be more than sufficient and would have a large flat top that could be further crenelated etc,.
51 degree slope is what the big pyramid used and considering it originally has casing stones it would be very difficult to assault. You could use a much steeper slope, it would all come down to how much weight the materials at the bottom and the foundation could support. The less steep the slope, the more the weight is spread.
If you want to be a bit more modern and use reinforced concrete bricks and a vertical wall then it depends on how you do it. With no bracing high end is 36 times as high as your base is thick or if you use working stress or ultimate strength design there is no height limit, but a lot of other factors need to be taken into account for that. With bracing the sky is the limit.
Solid concrete can be as thick and as high as you want, e.g., the Hoover dam, but even though built on solid rock the dam deformed the crust of the earth and caused several earthquakes due to its weight.