The universal law of gravitation is valid for
Spherical bodies
Newton's Law of Universal Gravitation
It is strictly valid only for point particles, it is mathematically possible to show that it also holds for the interaction of any pair of spherically symmetric mass distributions, provided that the positions of the spherical masses are specified by their centers.
The Law applies to all objects with masses, no matter how large or small. If the distance between two massive objects is very large in comparison to their sizes or if they are spherically symmetric, they can be regarded as point-like masses.
The universal law of gravitation is valid for spherical bodies