They would largely be the same with minor differences. For an overview on Japanese diet in the 18th century, I wrote a huge post here.
In both areas, the average meal would consist of rice/millet as the main, with a soup dish and generally 3 side dishes (assuming one could afford it). One would be vegetables, one would be meat/fish (something 'heavy'), and the last one would range from roots, mushrooms, beans, etc.
The biggest differences would not be China vs Japan but mountainous/inland regions vs seaside regions, regardless of country. A seaside town in China would have more in common diet wise with a seaside Japanese town that it would with a Chinese town farther inland.
The diet of those who lived by the sea would, of course, include a great deal of seafood as well as various seaweeds. This is a plentiful source of protein that towns inland would not have access to without a nearby river or lake.
While we're talking about this, generally, Japanese diets included more seaweed and incorporated it more into soups and other dishes than the average Chinese diet.
One thing that Japan wouldn't have a lot of is dates. These were cultivated plenty in Hebei but were not in Japan.
Another general difference is that your average Japanese diets in general are more vegetarian than Chinese diets, particularly if we're talking about Hebei, which in general consumed more meat, including beef, goat, and various wild game. by comparison, other areas in China, when they did eat meat, they generally ate pig or chicken.
Speaking about fatty meats, Chinese cuisine in general fried food more than Japanese cuisine. By the 18th century, using lard to fry foods was a long established tradition. Sesame oil was also often used, sold by street vendors directly after pressing. Traditional Japanese cuisine hardly uses frying, with Japanese fried food like tempura actually being brought to the country by Portuguese traders in the 16th century.
BUT, don't let this mislead you to believe that much of Chinese cooking involves frying things in oils! I've met many people who say Chinese food is 'too greasy'. This is because their main exposure to Chinese food is this
In fact, Chinese has at least 7 different words that mean 'boil' or 'stew' and generally vegetables were traditionally prepared steamed or boiled, which were the main part of the meal, not the meat.
That being said, Chinese cuisine generally involved more frying and in general, more 'working' with the food than Japanese cuisine. Many Japanese cooking styles focus on retaining the inherent or 'natural' taste, look and form of foods. Chinese cuisine often involves taking ingredients and mixing them to create complex 'harmonies' among the various tastes and ingredients, often involving complex sauces (which incidentally does not include any creams or dairy based sauces).
So if we were painting in very very board strokes, Japanese cuisine, stylistically, often focused on presenting the ingredient, keeping a light hand in the cooking process while Chinese cuisine focused on creating harmonies between various ingredients.
Ingredient wise, much of the foodstuffs available to the average townsperson in China would be very similar to what was available to the average townsperson in Japan.
The 5 grains, of which rice, wheat and millet were the most important. Various vegetables, like cabbages, radishes, etc. Fish, poultry, meat (though the lower classes obviously could not afford to pay for meat very often, hence the largely vegetarian diets in China and Japan). Beans, particularly soy beans, which was processed into soy sauce and tofu. Various roots, tubers, and mushrooms. Etc etc
The greatest differences were region based, due to the inherent accessibility (or inaccessibility) to what foods were in the area, not country or culturally based, at least ingredient wise. Stylistically, Chinese regions' cuisine differed with each other sometimes nearly as often as they did with Japanese regions.
If you have follow up questions I'd be happy to answer them. Cheers!