Navigation cameras and odometry (local)
Except for Curiosity and Perseverance, rovers haven't had sufficient processing capability to implement navigational autonomy in order to make any use of "knowing" where they are.
Curiosity and Perseverance do have actual knowledge of their locations on the planet both from navigation and odometry information they gather locally, and by regular updates from Earth. These are used, along with ephemeris information to time communication links to satellites orbiting Mars and to time and point their high gain antennas correctly towards Earth for direct rover-to-DSN links.
Very Long Baseline Interferometry (VLBI) from Earth can locate an object on the Moon to meter precision. This was developed using the static ALSEP transmitters left there by Apollo landing missions.
VLBI on the Apollo crewed rovers?
I do not yet know if this was done. I have a hunch that it would have been tried.
VLBI on Chang'e 3 lunar rover
The Chang’e 3 lunar lander landed on the Moon on 14 December, 2013, as part of Chinese Lunar Exploration Program (CLEP). VLBI was used to track the Chinese Chang’e 3 lander during its landing sequence and after landing; in addition VLBI was used to determine rover-lander relative positions on the lunar surface. The relative positions of the rover were determined at the meter level and the absolute position of the lander to within about 10 meters. Chang’e 3 was also observed in geodetic VLBI experiments under the IVS OCEL (Observing Chang’e-3 with VLBI) Research and Development project. Note that the OCEL observations were inserted into conventional geodetic observing sessions and did not hamper their geodetic use.
Same-beam very long baseline interferometry observations were performed between the rover and the lander of Chang'E-3 and differential phase delay data were obtained with the minimum random error of about 0.03 ps. These data were used to monitor the rover motions, as small as several centimeters, including movement, turning, and attitude adjustment. The relative position between the rover and the lander was precisely measured with an accuracy of 1 m, which is an improvement of 10 times compared with that of the Apollo project.
Differential phase delays on six baselines and their changes resulting from various movements of the rover.
We present results from the analysis of observations of the Chang’e 3 lander using geodetic Very Long Baseline Interferometry. The applied processing strategy as well as the limiting factors to our approach is discussed. We highlight the current precision of such observations and the accuracy of the estimated lunar-based parameters, i.e., the lunar lander’s Moon-fixed coordinates. Our result for the position of the lander is 44.12193∘N, −19.51159∘E and −2637.3 m, with horizontal position uncertainties on the lunar surface of 8.9 m and 4.5 m in latitude and longitude, respectively. This result is in good agreement with the position derived from images taken by the Narrow Angle Camera of the Lunar Reconnaissance Orbiter. Finally, we discuss potential improvements to our approach, which could be used to apply the presented concept to high-precision lunar positioning and studies of the Moon.