Dpi is dpi and megapixels are megapixels.
Apples and oranges.
These are two different values that can be chosen independently.
12mp means that the total number of pixels should be 12 megapixels. Your camera is capable of shooting images with more megapixels so you might have to reduce the size of the image so that it is 12mp.
300dpi means that the resolution should be set to 300 dots (pixels) per inch. This is only relevant for print.
Also if its okay to shoot at RAW for this case?
This is yet another entirely unrelated thing. You have read the contest rules. It would be very odd if you were not allowed to use RAW, because you likely have to send in a common file format like .jpeg and nobody knows what intermediate formats were used. Also, there's always RAW involved, whether the conversion happens in camera or in post production doesn't really change that.
And would I be able to edit in lightroom the image?
Again, read the rules of the contest! If they have no restrictions about image editing you can do whatever you want. But as it is a street photography contest, I'd guess that only minor image adjustments are allowed and major image manipulations are not ok. But as I stated previously: this is all up to the contest and you simply have to read the rules.
If you are unsure, just send them an email and ask.