Is it possible to attain a law degree by studying only online?
It may be possible in a few states. Most states, however, require bar applicants to graduate from ABA-accredited law schools.
And if so which states will allow the student to sit for the bar after getting the degree in this manner?
I don't know. Maybe California and/or a few other western states. They tend to have the most relaxed standards for admission to the bar.
Can an individual once admitted to the bar in a state which does allow for an online education then petition other states?
Every state has its own admission requirements. California, for instance, is a non-reciprocal state. Here's a handy chart