Be careful
1.- there is no problem applying for the green card lottery, but you have to be aware that if you are selected you might need to go back to the country of prosecution, because the green card of the lottery is processed at the country of citizenship. Only through asylum (refugee) and marriage are the only ways that you can adjust your status in the US withouth leaving the country, for the rest you have to leave the country.
2.- you also have to be aware that if you overstayed your visa in the US, you might be subject to a ban of entry of 3 or 10 years depending on the overstay. So even if you are selected in the green card lottery there is no waiver for overstaying your visa in the US and you wouldn't be allowed back in the US. So even receiving the green card through lottery does not mean that you will be allowed back in the US.
be careful