CB350F std piston is 47.00mm.
CB350F cyl sleeve OD 55.00mm upper, 54.3mm lower.
CB400F Piston 51.00mm.
CB350F pistons are discontinued and very hard to find. plus they have a one piece oil ring.
CB400F pistons are still available and have a better 3 piece oil ring.
Yes you can just fit the CB400F Std 51mm piston, this will be the maximum you can go and will give you a sleeve wall thickness of 2.0mm on the upper and 1.8mm wall on the lower part of the sleeve.
It is possible to fit the CB400F sleeves, but boring and machining of cyl and upper crankcase is required for them to fit. but then you can go up to a 54.5mm yoshi or Wiseco piston kit.
Or fit the complete 400F cyl and head. would still have to open up the crankcase. Plus replace the 2 front middle cyl studs for custom items.
Or I make custom sleeves for the CB350F cyl block. still have to machine to fit etc.
Hope that helps a bit with your decision.
Kevin