50/60 Hz signals and ADC sampling frequency
But my system won't know if it's a 50 Hz or 60 Hz signal to adjust the number of samples, so is there a way to capture both frequencies with a common number of samples and sampling frequency?

Start measuring at a zero crossing, and then measure until you see two more zero crossings.  This will ensure that you always have one full cycle of the waveform, even if you do not know the frequency in advance.