It depends on the school you attended. If it was not a reputable school then many grad schools - and most of the strong ones - will not accept that degree. Some (usually lower tier) will. Most won't. But if you did an online degree with a school that is highly reputable - which has a great rep for its brick and mortar campus - then yes, many grad schools will be okay with that. Some won't, but many will.
In addition, be aware of any accreditation requirements that schools in your field must have. Your undergrad school, at a minimum, should have been regionally accredited in order for it to be acceptable, but some fields also require that undergrad programs have had certain types of professional accreditation. For example, if you studied engineering with a school that was regionally accredited but did not have ABET accreditation for its engineering programs, you are sunk.
So, online degree from Carnegie Mellon? You're probably good. Online degree from U of Phoenix? Not so good.