The radius of a circle can in one way be determined if we know its Diameter $D$. It can be determined by the equation:
$r = \frac D2$ ..... (I)
We can also determine the radius of a circle by Euclidean distance formula which is as follows if the centre of a circle is at origin:
$\sqrt{x^2 + y^2} = r$ ..... (II)
If we compare the equations (I) and (II), then we get:
$\frac D2 = \sqrt{x^2 + y^2}$
OR
$D = 2(\sqrt{x^2 + y^2})$
Is it allowed to establish an equation to determine the Diameter of a circle like the above?
Yes is valid. I don't know where is your confusion but notice that $x^2+y^2\geq 0$. Therefore $\sqrt{x^2+y^2}$ is always well defined in the sense that you get a real number as a result, and of course is legal two divide by two. So the expression is mathematically valid and you are able to calculate it for any point $(x,y)$ of the space. The reasoning of deduction of the formula is also flawless.