I figure this question is appropriate for this sub because I'm mostly asking what kinds of historical notes are being struck by the game.
Super Mario Bros. features surly traitor-mushrooms, green and blue turtles, black turtles that can't be hurt by fire, hammer-throwing turtles and giant, spiky dinosaur turtles, along with red-and-orange mushrooms that make you grow, green-and-yellow mushrooms that give you a chance to recover from failure and bouncing stars that make you impervious to damage.
SMB2 has a pink, cross-dressing lizard that spits eggs, and is arguably even weirder than SMB1.
How much of these were riffs on Japanese legends (or perhaps something more contemporary?) and how much was just weird videogame stuff?
Super Mario Bros does have a cross-section of Japanese culture and video game design, but it's probably not in the way you expect. Some of the features are simply ways to overcome technology limitations. For example, Mario's mustache and overalls were ways to make Jumpman's nose and arms visible in the original Donkey Kong game. A backstory about him being a plumber (originally carpenter) comes from that. Once he you have the idea that he's a plumber, you can create a game where he's crawling through pipes, and the original Mario Bros is formed. Going into pipes and things coming out of pipes is connected to an element of Japanese culture, though. Iwata says it comes from Manga. I'm not sure where that ultimately comes from, unfortunately (it has quite an Alice in Wonderland vibe to it).
Mario Bros introduced the turtle as an enemy. In the same link as above, Iwata explains why a turtle enemy was created. Mario was crawling through a sewer, so he had platforms. Someone got the idea of letting you hit the platform from below. Unfortunately, that turned out to be a pretty easy game. The idea of a turtle came about because it was the first two-hit animal they could think of from a design perspective. The koopa came from that.
Iwata said they created the mushroom to make Mario big about halfway through designing the game. In that interview, he said mushrooms are associated with magical worlds and didn't go further. However, psychedelic and "laughing" mushrooms have been used in Japan since at least Jomon times. The Goomba was created as a player tutorial. In World 1-1, the goomba approaches you at the beginning. If you accidentally jump on him, you learn to jump on enemies. When the mushroom appears, you don't know it's good, so you try jumping on it again and you grow larger. The sprite of the goomba is even a re-colored mushroom (which saves design space). The name isn't exactly from Japanese culture, but in Japanese, they are called kuribo (クリボー), which means something to the effect of Chestnut Boy.
Bowser is named Koopa in Japan (クッパ) or Great King Koopa (クッパ大王), Demon King Koopa (魔王クッパ), or Great Demon King Koopa (大魔王クッパ). Koopa is the Japanese word for the Korean dish gukbap. No comment on its tastiness. His design is supposed to be based on the Ox in Alakazam the Great, which is a Japanese anime based on the Chinese folktale Journey to the West. Journey to the West was also part of the inspiration of Dragonball, which also derives names heavily from food--if you reverse the syllables of the Japanese word for vegetable (yasai, 野菜), you get saiya (which became Saiyan in English). Alakazam is available in an English dub and is considered one of the worst movies of all time, if you'd like to check that out. Unfortunately, Miyamoto's ox looked a lot like a turtle You can draw your own connections from that.
So, while most of the creations in Super Mario Bros are not related to Japanese culture, some of the elements can be seen as drawing from it. Bowswer in particular has a lot of elements from Japanese culture, but is also a result of a bad drawing.
Just a brief note on why SMB2 was so strange: It was originally developed as Doki Doki Panic, a game with no relation to the Mario Bros franchise, and the enemies are supposed to be related to a Japanese tech expo run by Fuji. It was adapted into SMB2 for a Western release after concerns that the Japanese version of SMB2 (released many years later in the West as The Lost Levels) wouldn't sell well due to being extremely difficult.