Plenty. India, Kenya, Australia, Canada and various ex-SSRs all spring to mind. Not many without violence on the run-up, I'll grant you, but in many cases, the actual process of independence was performed entirely legally.
Saying that India got her independence legally is quite a stretch. There were plenty of mutinies, bloodshed, violent and non-violent movements before the British (massively weakened by the WWII) decided that they had enough. While it is true that India did not declare unilaterally declare independence (some leaders did, but they did not gain widespread public support) and start a civil war, the independence movement itself was not legal and most leaders were branded terrorists and incarcerated.
Yes, often quite a bit of violence in the run up. Whether the imperialist side wants to try and look good at the point of capitulation or not has little to do with how “legal” the effectual parts of fighting for independence are.
To suggest that, e.g. Gandhi didn’t have a meaningful role in achieving India’s independence, because the British considered his actions illegal, is very silly.
I'm from ex-Soviet country called Lithuania, and no, although Lithuania was the first country to declare independence from the Soviet Union, it was not done within Soviet legal framework in any way.