Yes, as far as I know the lottery is independent of anything else, but you should check the USCIS website and consult an immigration lawyer.
Be careful with the lawyer: try and get one through a recommendation of someone you trust who has used their services. Because of the high demand for immigration into the United States, there are many unscrupulous people involved in such matters.