[..] (I honestly don't know if Bangladesh was a colony it's hard to keep track)
Sort of, in a way, ish
The Indian subcontinent was home to many different countries in the past. On a couple of occasions one of those countries succeeding in conquering enough of the others to form an empire, the biggest of which covered most of the Indian subcontinent for some centuries about 2000 years ago. Very successful as empires go, but of course it fell apart as empires do.
Time passed, countries rose and fell and merged and disappeared, the usual stuff.
The never-ending Islamic war of conquest of everywhere rolled over the Indian subcontinent, mass murder and slavery and all of the usual. So India was sort of unified but not really. It was too big for a bona fide unification.
The British empire's war/political conquest of almost everywhere rode up and took over with its usual mix of good and bad. It ended slavery but it was absolutely a ruling class. Another foreign ruling class. India remained sort of unified but not really. It was still too big for a bona fide unification.
The British empire fell apart as empires do and the whole of the Indian subcontinent was to be one country with its own government having the headache of a country that was sort of unified but not really. Still too big.
The politicians of India rejected India being one country because of the biggest, most intractible cause of lack of unification - religion. So the country was partitioned into 3 parts. Most of the Indian subcontinent became India and the two areas of the Indian subcontinent which had the highest proportion of people who were muslims became Pakistan, but those two areas were on opposite sides of the Indian subcontinent so Pakistan was in two completely seperate parts, seperated by a long way. Referred to as West Pakistan and East Pakistan.
A bit later, East Pakistan decided to not be part of Pakistan any more and declared independence, renaming itself Bangladesh.