US held elections in 1864
France held elections in 1871 during a large war where parts of the country were under Prussian occupation
Korea held elections in 1952
Vietnam held elections in 1956
Iraq held elections in 2005 with large parts of the country under foreign backed insurgent occupation
Georgia has held elections in 2008, 2012, and 2020.
Ukraine itself held elections in 2014 and 2019. Either the Donbas and Crimea are Ukrainian or they're not.