There was a Japanese exhibition, in London, at the time that Gilbert wrote THE MIKADO and all things Japanese were THE "rage". No English person really knew much at all about Japan, nor the Japanese at that time, but it was a VERY timely theme to use.
Just as "PATIENCE" was jabs at the "aesthete" movement/Oscar Wilde,"PRINCESS IDA" was poking fun at early "women's lib"/college for women, and parts of "IOLANTHE" had jibs at Wagnerian opera and the English Parliament ( specifically the House of Lords ), and "TRIAL BY JURY", needled the English court system.
You were taken in by the misinformation in the Topsy-Turvy movie as I was -- briefly. I learned the Knightsbridge Exhibition opened about 2 months *after* Gilbert had completed Act 1. There seems to be some truth to the story he was inspired by a Japanese sword in his study but that story is also in some dispute. But "Japan Mania" had overwhelmed England at the time and I agree it was a very timely theme.