Certain cartridges would work this way, hence you had the simple "pass-through" adaptors that would allow the SNES to read the region code of a host cartridge plugged into the back whilst reading the game code of the foreign cartridge plugged into the top. Other ones were much more clever (or rather awkward), and are generally those using DSP chips such as Starfox, Stunt Race FX and on earlier adaptors, even Mario Kart.
US SNES games will work without any trouble in a Japanese Super Famicom, you just need to remove their from their square housing so that they will physically fit into the Super Famicom, or get a riser board that will simply lift the connections outside of the cartridge slot so you can just plug the US square cartridges into the top.