So here's our restatement (see discussion in comments above):
$$
(ma)^2 + (nb)^2 = (pa)^2
$$
Please note that this means that $(ma, nb, pa)$ must form a Pythagorean triple, with hypotenuse $pa$. So you're trying to find all Pythagorean triples where the hypotenuse and one of the legs have a common divisor, $a$.
http://en.wikipedia.org/wiki/Pythagorean_triple
Since every pair of integers has a common divisor (in some cases the GCD is 1, but it's still a common divisor), you basically just need to find all Pythagorean triples.
Note: if the three sides of a Pythagorean triple are all coprime, then we call it a primitive Pythagorean triple. If any two sides in a Pythagorean triple have a common divisor $d$, then all three sides share that divisor (why?), so every Pythagorean triple is a multiple of a primitive Pythagorean triple. Thus you may always take $b=a$ in our equation above, and solutions with $a=1$ correspond to primitive Pythagorean triples.
There are various formulas for generating Pythagorean triples, which would solve your problem completely.