Vampires are known to sleep in coffins, and it is possible for a non-vampire character to sleep in one. In Dawnguard, sleeping in a coffin as a vampire or Vampire Lord will apply the "Vampiric Blood Rested" bonus that grants a 10% Resist Magic effect for eight in-game hours.
In The Elder Scrolls V: Hearthfire, coffins are a craftable piece of furniture for a mansion. They are automatically placed in the cellar. For the option to build a coffin to appear, one needs to be a vampire.