To some extent. But less because the British forced it on everyone than because Nigerians, Indians, Filipinos have all found it useful for their own purposes: these are all polyglot societies in which the elevation of a regional language would advantage one ethnic group over others.
But how did English become so dominant in Europe? It seems mostly like the Nordic countries heavily adopted English as an international language, and this was a major beachhead for English. German and Russian had historical baggage, but why not French, historically the standard?
Languages have always spread through invasion. English is spoken in the US, Australia, much of India etc because English troops arrived, latin America speaks Spanish because Spanish with guns went there.
In other words, Spanish is not more popular because Spaniards didn't invent the modern economy.