Could I get sick from accidentally cooking an olive can metal lid in my spaghetti sauce?
Very unlikely.

Cans are made from either steel (uncritical) or aluminum (dito), covered with a thin layer of tin (dito) or epoxy coating. These materials are explicitly choosen because they are food-safe1, even at higher temperatures than you use with home cooking: Tin cans are sterilized after filling to make the food inside shelf-stable.

So the only way where non-foodsafe components might be introduced would be any printing/laquer/paint, which is typically on the side of the can, not on the lid.



1
The epoxy in the cans may contain Bisphenol-A, which acts as endocrine disruptor (influences the hormone system) and is banned for baby bottles in some countries, e.g. all the EU. The FDA considers its use for food packaging safe.