Potentially, yes. In order to buy a Marketplace plan, you must have a qualifying immigration status, such as permanent residency (green card), certain types of visas, or refugee status. You can find more information about qualifying statuses here.
If you are not lawfully present in the U.S., you are not eligible to buy a plan on the health insurance Marketplace. However, you can shop for individual health insurance outside of the Marketplace and some states may offer you financial assistance, depending on your income. To obtain coverage, contact a state-licensed health insurance company or a licensed agent or broker. Your state Department of Insurance can help you find one. (45 C.F.R. § 155.305.)