You can learn yoga at home, but it would help if you have an athletic background. However, it's not impossible. The best advice that I can give you is to listen to your body. Don't force yourself into any poses. If you can't go as far as you thought you could, just hold the pose at the point that you are at. You may go deeper in the pose in few seconds after, it may not happen until a few sessions later, but listen to your body.
Take that advice no matter where you start your practice, at home or in a class.