Yes, you can meditate in any position that you find comfortable. The danger of meditating while lying down in your bed is that you may fall asleep. If you prefer to meditate while lying down in bed there are a few things you can do to make sure you are actively engaging in meditation.
First, do not meditate when you are extremely tired or at the time when you normally go to bed. Second, do not get under the blankets. Third, have someone else around who can wake you up if you do drift off to sleep while you are meditating.