Value squared a dot product?

I was recently going through the proof of Compton scattering and I saw that they took a square value and wrote it as p^2=p(dot)p= etc... Is this true or all squared values?
 Recognitions: Homework Help Use the definition of dot product and see what you get for a general vector.

 Quote by SteamKing Use the definition of dot product and see what you get for a general vector.
<A,A>=AAcos(0)=AA(1)=AA=A^2

So this only applies when numbers are squared. I just find it strange that the dot product only applies to when normal multiplication is the square of a number and not at any other cases for example if A=/=B AB=/=ABcosθ. I guess I just don't understand where the dot product comes from enough to understand why it works like this.

Recognitions:
Homework Help

Value squared a dot product?

A dot B can be thought of a the projection of A onto B. If A and B are the same vector, then A dot B = A^2