The "Japanese" culture
- very clear social structure*
- idolation of the ideal death
These two elements of Japanese society would probably not occur in a fantasy world with monsters at every corner.
The strict caste system (samurai-merchant-peasant) was put in place
after Hideyoshi assumed power of the nation. It was a means of suppressing uprisings and preventing someone from doing just what he did (i.e., start out as a peasant (needle peddler) and make his way to the top). During the times of the warring states, there was a great deal of social mobility for someone with the skills or drive. Because of the presence of monsters, dungeons, and so forth, there's always going to be a place for need for strong warrior-types, and they'll always be able to acquire capital (treasure) to provide for jumps from one level of society to the next.
The strict honor codes and 'beautiful death' mindset came in times of peace, many years after the country was unified. There was a LOT of warriors roaming about with deadly skills, but no real means to own property and (more importantly) no one to fight. The codes control a significant chunk of the population with the power to band together and take over the country. If they're totally focused on submission to their lords (even to the point of death), they're less likely to make trouble.
In the warring states period, samurai were sneaky, double-dealing, and even surrendered in battle, so they could fight another day. The 'never surrender' shido is a romanticization or idealization that appeared in time of peace and became ingrained in the culture. And (to be frank) it's stupid in a time of war, because you've spent a lot of time and resources getting your men trained. They become expendable only in a time of peace.
In a fantasy society, you're always going to need that warrior caste. A monster could pop up at any time and start ravaging the countryside. If your fighters have the mindset of dying in an ideal manner...
Well, the tarrasque shows up, your warriors know its an unbeatable foe of 'divine' power. What better way to die? The tarrasque goes back to sleep because it can't possibly eat any more warriors, and your country no longer has a defense force. A pack of kobolds show up the next week and take over.