If two surfaces come into contact and a force is applied to them then the materials will distort. If the load is lower than the 'elastic limit' the the surfaces will return to their original condition when the load is removed, if the load exceeds the elastic limit then the material will remain distorted after the load is removed. This is called 'plastic flow'.
Now consider a round rod resting on the head of a rail. If a load is applied then both rod and rail head will distort until the contact area increases sufficiently that the load per unit area is insufficient to distort the parts any more. For a given load the more 'pointed' the rod is (that is it has a smaller diameter) the greater the local distortion in both parts and the sooner plastic flow will occur.
So the trick is to select a rod diameter (i.e. the wheel diameter) so that plastic flow in either tyre or rail does not occur with the axle loads anticipated.
This is very simplified, there are books and books written about Hertzian stresses and the like and what I described is the static case and takes no account of the dynamic stresses which occur when the vehicle is in motion. These have the characteristic that the instantaneous loading of the contact point can be significantly higher that the static case. (And also significantly lower...!)
So the choice of wheel diameter depends on a multitude of factors: axle load; wheel, tyre and rail materials and profiles; size of gear wheels for the drive; minimum size of brakes for heat dissipation; axle and wheel bearing dimensions and so on and so forth.
There is no simple answer!
