I do not know of codes governing this but on a practical note, while it may be convenient because of space and not having to put an extra vent in your roof or wall. I do not think it is a good idea. There may be times where you may get the humidity from the washroom exhaust back drafting through the kitchen exhaust, depending on the wind as wind will cause pressure differences at times. The other issue is that those washroom exhaust back draft dampers are not that great. Good for keeping out back pressure from wind and such but your kitchen exhaust will produce enough pressure that, I am sure you will end up with cooking smells in your washroom. Some cooking smells are very strong and at times smoke. Not good to have even small amounts back in your house in other areas.
Not sure if you live in the north or south but that washroom vent will need be vented directly outside. Especially if you live in the north, as you do not want that moist washroom exhaust air going into your attic. In very cold weather it will crystallize on the inner attic and when the weather warms it will melt and drip back into your house. Not good.
Both vents should be ducted directly outside.