The Government of India (Prior to Independence in 1947) would declare war, participate in international legal treaties, sign the UN Charter and engage in stuff that you'd normally expect a sovereign government engage in. What was the legal basis of England's overlordship of the Sub-continent? What ties did the Government of England have with the British Government in India? What was the legal relationship between them like? How did the Independence affect these ties and what changed?
It is such a broad question in scope that I can only answer it in part even though I know more about it. Please ask follow ups if you wish to because it is something we did study in school.
So after the Indian rebellion on 1857 ( or as British call it - the mutiny ) the British east India company was deemed unfit to rule Indian possessions and the crown took over those in the government of India act of 1858.
https://www.britannica.com/place/India/Government-of-India-Act-of-1858
Thus the government of India passed in the hands of the crown - through a spectators of state for India. The subsequent acts of the same name in 1919 and 1935 would change the nature of the government. But it would still be subservient to the parliament and still be governed by the Secretary of State for India (and from 1937 to 1947 by SOS for India and Burma). Post independence India continued to be a dominion of England ( governed by a viceroy/governor- general appointed by the crown ) until the ratification of the constitution on 26th January,1950 when India became a republic and then became part of the commonwealth.