Purpose: Convolution/superposition algorithms used in megavoltage (MV) photon radiotherapy model radiation transport in water, yielding dose to water-in-water (D w,w ). Advanced algorithms constitute a step forward, but their dose distributions in terms of dose to medium-in-medium (D m,m ) or dose to water-in-medium (D w,m ) can be problematic when used in plan optimization due to their different dose responses to some atomic composition heterogeneities. Failure to take this into account can lead to undesired overcorrections and thus to unnoticed suboptimal and unrobust plans. Dose to reference-like medium (D ref,m* ) was recently introduced to overcome these limitations while ensuring accurate transport. This work evaluates and compares the performance of these four dose quantities in planning target volume (PTV)-based optimization. Methods: We considered three cases with heterogeneities inside the PTV: virtual phantom with water surrounded by bone; head and neck; and lung. These cases were planned with volumetric modulated arc therapy (VMAT) technique, optimizing with the same setup and objectives for each dose quantity. We used different algorithms of the Varian Eclipse treatment planning system (TPS): Acuros XB (AXB) for D m,m and D w,m , and Analytical Anisotropic Algorithm (AAA) for D w,w . D ref,m* was obtained from D m,m distributions using an in-house software considering water as the reference medium (D w,m* ). The optimization process consisted of: (1) common first optimization, (2) dose distribution computed for each quantity, (3) re-optimization, and (4) final calculation for each dose quantity. The dose distribution, robustness to patient setup errors, and complexity of the plans were analyzed and compared. Results: The quantities showed similar dose distributions after the optimization but differed in terms of plan robustness. The cases with soft tissue and high-density heterogeneities followed the same pattern. For AXB D m,m , cold regions appeared in the heterogeneities after the first optimization. They were compensated in the second optimization through local fluence increases, but any positional mismatch impacted robustness, with clinical target volume (CTV) variations from the nominal scenario around +3% for bone and up to +7% for metal. For AXB D w,m the pattern was inverse (hot regions compensated by fluence decreases) and more pronounced, with CTV dose variations around -7% for bone and up to -17% for metal. Neither AXB D w,m* nor AAA D w,w presented these dose inhomogeneities, which resulted in more robust plans. However, D w,w differed markedly from the other quantities in the lung case because of its lower radiation transport accuracy. AXB D m,m was the most complex of the four dose quantities and AXB D w,m* the least complex, though we observed no major differences in this regard.