Of the two sentences given,
- *He can have cooked dinner
- He could have cooked dinner.
the first is ungrammatical. Epistemic can is a Negative Polarity Item, which means that it can only occur in a negative context, like this:
- He can't have cooked dinner.
Without the negative in can't, though, it's ungrammatical.
So it's not "present" and "past". Can and could are two different modal auxiliary verbs, with different (though related) meanings, and quite different grammar requirements.
As to the second sentence, the have is the mark of the Perfect construction, which is always followed by a past participle of the next verb in the verb chain, as here by cooked.
The perfect construction is the only way to get a past time meaning (not "past tense") into a verb phrase that starts with a modal, because modals aren't tensed. Even though your textbook or teacher might tell you, they're talking about Middle English; Modern English modal auxiliary verbs are untensed. So you can't say, about the past:
- *I musted go yesterday (you say I had to go yesterday instead)
- *He coulded cook dinner (you say He could have cooked dinner)
How modals interact with perfect varies:
- *can have is ungrammatical, but not could have
- will have and would have are both fine but mean different things
- *shall have is ungrammatical, but should have is fine
- may have and might have are essentially identical in meaning.