Are both of these phrases grammatically correct?
- Preparation of medicinal plant extract.
- Preparation medicinal plant extract.
Can both be used as headings?
These are rather phrases than sentences but it does not matter for all practical purposes.
The first is correct:
Preparation of medicinal plant extract.
In the second, you need to change word order as someone has already suggested in the comments:
Medicinal plant extract preparation.
However, it still sounds a bit awkward as such a long subject is difficult to comprehend, so if I were you I would go with the first sentence.
Generally, such transformations between A of B and B/(adjective from) B A often exist:
Bombers of WWII <-> WWII bombers.
States of Europe <-> European states
The US constitution ratification <-> The ratification of the US constitution