Objective: DNA damage caused by radiation is correlated to the complexity of the spatial distribution of the ionizations. A stochastic quantity used in nanodosimetry is the ionization cluster size (ICS). ICS is the number of ionizations created by a particle track, and all its progeny, in a specific volume. The track-structure can be characterized by the frequency distribution of the ICS via its probability distribution, associated moments (e.g. the first moment m1) and cumulative probabilities (e.g. f3); parameters commonly known as nanodosimetric quantities. In this work, Monte Carlo simulations were used for the calculation of nanodosimetric quantities, m1 and f3, and the estimation of the associated uncertainties to specific input variables using protons and carbon ions. Methods: In the first stage, TOPAS-nBio Monte Carlo track-structure simulations were used to study the sensitivity of the calculation of nanodosimetric quantities from four input variables: the energy spectrum of the source particles, the geometry of sampling volume, the geometry of the scoring envelope and the algorithm for ionization sampling. In a second stage, condensed-history Monte Carlo simulations with TOPAS were used to estimate the effect of such uncertainties in the distribution of nanodosimetric quantities in a patient-size water phantom. Results: Comparison between monoenergetic and polyenergetic sources showed no statistical significant difference (1 standard deviation) in the calculation of the nanodosimetric quantities. Results from simulations using different sampling volume geometries, showed a decrease in m1 of 5-15% and 4-6%, for carbon ions and protons respectively. For f3, results showed a decrease of 2-16% and 8-13%, for carbon ions and protons respectively. Results from simulations using different envelope geometries showed a decrease in m1 and f3 from 0-2.5% and 0-8%, for protons only. Finally, using the ionization sorting algorithm had the largest impact on scoring the quantities, with m1 and f3 increasing by 10-35% and 10-24%, respectively. Conclusion: The impact of uncertainties in key input quantities of the MC simulations on commonly used nanodosimetric quantities was successfully evaluated. The results of this work provide insight into the sensitivity of track structure simulations to certain parameters and their uncertainties.