My kitchen is wired with 10/3 wire for a cooktop stove, however my new cooktop recommends 8/3 wire and 40amp breaker. Is it safe and legal to use the existing 10/3 wiring?
10/3 cable absolutely requires a 30A breaker or less. Period. NEC 240.4(B), which overrides any number anywhere else in Code (though all those other places also limit NM/UF/Romex to 30A).
You will need to review your range's UL-approved instructions to see whether it "recommends" or "requires" 8/3 and a 40A breaker. If it "requires", then pull 8/3 (leave the 10/3 in place; you'll thank me later) or return the cooktop and get a 30A cooktop.
There shouldn't be any trouble finding a 30A cooktop. The 40A cooktops are luxury items, and if you're buying luxury items, you can definitely handle adding the correct wiring.
The standard wiring for houses which have separate cooktops and ovens (that itself being "luxury") is a 30A/#10 for the range, and a 20A/#12 per oven. (sometimes 30A/#10 for two ovens). Lowbrow range-oven combos call for #8/40A or #6/50A. Sometimes, under specific conditions, range/oven separates are allowed to share a #8 or #6 cable. But that is not your house.
Instructions and labeling are approved by UL as part of the appliance's UL listing. That's why they're so weird and hard to understand sometimes because manufacturers don't want to change that which has been approved. You must follow the instructions (NEC 110.3), because UL won't certify its reliability in other conditions.
You should always follow manufacturer recommendations on wiring requirements for any appliance. Upsizing the feed isn't usually an issue but undersizing it can cause serious problems including fire. If it's too expensive or difficult to run 8/3 you need to consider exchanging your stovetop for one that can be operated safely on your current setup.
You might want to check with the tech folks for the manufacturer but typically when they call for 8/3 and 40 amps that's what the appliance needs to operate safely.