I've always just assumed, yes, of course, bayonets are universal to this period, so why not in Japan?
Then I started noticing a lot of period art shows infantry dressed with modern uniforms using katanas and not bayonets. And on the rifles themselves, again, no bayonets.
Then I got to thinking, who actually fought the Boshin War? Were they really just peasant armies?
I think not. The Boshin War started suddenly, after a long period of peace. Japan, was not prepared, its population not mobilized. I would venture the given the speed of conflict and the small sizes of the forces involved, that the majority of combatants were actually low ranking samurai, professional soldiers.
This would explain the preferrence of katana over bayonet. The bayonet was nothing but a shorter yari, a commoner weapon. Samurai used it often too in the Sengoku period out of practical necessity, but during the long Tokugawa peace, the cult of the katana came to permeate the samurai mindset. For the Boshin War samurai, the sword was the very symbol of their class, replacing the yumi and the horse.
From a practical standpoint, the katana is much more effective against infantry. And Japanese cavalry of that period were not significant on the battlefield to require spear formations.