Yes. California licenses internet traffic schools as their own DMV category, and courts accept them the same as classroom schools. Online is how the overwhelming majority of California traffic school gets done.
The question worth your thirty seconds isn't whether online counts, it's whether the specific school does. California's market has hundreds of licensed schools and a fringe of unlicensed lookalikes, and the DMV settles it definitively: its public traffic school list is searchable by business name and shows every licensed school, its license number, and whether the license is active. Any legitimate school will also display its license number on its site. If you can't find a school on the DMV list, spend your money elsewhere.
Eligibility rides on the ticket, not the format: your court notice controls whether you can attend at all, the once-per-18-months masking window applies online or off, and commercial license holders are excluded either way.
Every school we compare on the California page is DMV-licensed with the license verified, and the fee stack is on our cost page.