I have a Pakistani passport. I want to know whether signature on passport should be same as on Identity card or it can be different?
Nobody bothers (you) about that. When you go abroad and present your passport, they don't ask you to also present your national identity card to cross match the signatures.
Many countries don't even have a separate national ID card.
Unless someday they start doubting your identity. On such a day this can become a headache. At that point, everything must line up (not necessarily match up still). As long as its a legitimate case you will be good.
Keep your ID card well protected and away from the passport when you are going abroad, You don't want to lose both things together someday. You do not have to present your national ID card to immigration officers if you are presenting a valid passport, unless specifically requested. There is no compulsion to even carry it, except for a rainy day.