I don't understand the difference between the dot product of two vectors and the scalar projection of a vector onto another one.
To me it looks like they are both (geometrically) the length of the vector projection. I am wrong since their formulas are different, so can anyone explain why?

The output of a dot product is a real number. The output of a projection is a vector. If you look at the formulas, the scalar projection does not depend on the length of the vector you are projecting onto.
According to Wikipeda, the scalar projection does not depend on the length of the vector being projected on. If you double the length of the second vector in the dot product, the dot product doubles.