As long as the house is warm then yes it's perfectly fine for a baby or toddler to sleep in just a diaper without anything else on.
If it's cold out though I would put a sleeper or footed pajamas on the baby for added warmth especially if they're tiny and under a year old.
But if the child is warm or if the child is hot then yes sleeping in just a diaper is just fine for the baby or toddler.