Yes, you may apply even if you are in the U.S. illegally. You may apply for Asylum regardless of your immigration status as long as you file your application within one year of your last arrival or demonstrate that you are eligible for an exception to that rule based on changed circumstances or extraordinary circumstances, and that you filed for Asylum within a reasonable amount of time given those circumstances.
Yes, however, you may be barred from being granted Asylum depending on the crime. You must disclose any criminal history on your Form I-589, Application for Asylum and for Withholding of Removal, and at your Asylum interview. Failure to disclose such information may result in your Asylum claim being referred to the Immigration Court, and possible fines or imprisonment for committing perjury.