Yes, you can cook the prawns or shrimp with the shell and head, they add an umami flavour to the dish and make it juicier as they contain water-soluble flavour compounds, proteins and sugar that get absorbed into the flesh. You can remove the shells later while eating.