Now my question is that in my country, crypto is not legalized, so in case if anyone is scammed through P2P, we can't take up this matter in the legal court because the country does not recognize the transactions of crypto in the first place.
Does this gives a free hand to scammers as they know that they cannot be punished by a court of law

If crypto is banned in your country exchanges might be blocked from operating except if you use VPN or other anonymizing browsers. Engaging in such crypto transactions makes you a criminal because you are violating the law of the country thereby committing a crime. He that comes to equity must come with clean hands, so you cannot take legal action against a scammer because you are not also innocent. Since the transaction is illegal before the law, the court has no locus standi to entertain such a matter. It will definitely give scammers the freedom to scam as many people as possible because the transactions are illegal in your country.