Yes, that's correct. According to the Heisenberg uncertainty principle (HUP), there is a fundamental limit to the simultaneous precision with which certain pairs of physical properties, such as position and momentum, can be known. The more precisely you try to measure the position of a particle, the less precisely you can know its momentum, and vice versa.
In the case of a photon, which is a massless particle, it always travels at the speed of light in a vacuum. This means that its momentum is directly proportional to its frequency or energy. However, due to the HUP, if you try to determine the photon's position with high precision, the uncertainty in its momentum (and hence its energy) increases. Consequently, it becomes impossible to simultaneously measure the exact position and momentum of a photon.
This principle applies not only to photons but also to other particles, such as electrons and other quantum objects. The uncertainty principle is a fundamental aspect of quantum mechanics that reflects the probabilistic nature of quantum systems and places limits on the precision of our knowledge about certain pairs of complementary properties.