Whether it’s okay to drive a car with a check engine light on depends on whether the light’s solid or flashing.
As noted, if the light’s flashing, that means you should pull over immediately and consult a professional. If the light’s solid, then it’s probably a small issue you can fix yourself.