I have found the answer here. Although it is not completely explained mathematically in my opinion, it works well.
The code I use is like this:
private void Start()
/// Source: https://forum.unity.com/threads/dynamic-loaded-object-fit-to-screen-size.349794/
As this question is kinda 2 questions in one, I'm going to answer the one that I think is the root of your problem (scale sphere relative to plane). Because if I read this correctly, the pixel part sounds like you only want to do that because you couldn't find the solution to your original problem.
In Unity, a position is based on 'units'. a 'unit' doesn't ...
When the canvas is set to screen space overlay, the z isn't going to do anything as 'Screen space overlay' uses an orthographic camera which renders everything between z -1000 and z 1000 the same. It is not going to look like it is closer to the camera. That is just how an orthographic projection works..
I think you'd either want to set it to Screen space ...