Similar to how the Land of Oz is located. Characters are said to travel there from real world locations (namely, Kansas in Dorothy's case) even though the place is largely magical and doesn't seem to be reachable in reality. So I imagine Mushroom Kingdom is bordering on some real world location, and that's part of the imagination, such as how Brooklyn is somehow connected to that place as portrayed in the Super Mario Bros. Super Show cartoon.
Thank you for reading.