In my experience, doggy bags are taken from restaurants where the diners have paid for the food but are unable to eat it all.
It's perfectly fine to have a plate made for an invited guest who couldn't attend a home dinner party because of illness. It's also fine to ask for a dessert to be taken home, especially if the dessert is something like a cake or pie that can easily be sliced up and wrapped.
Of course, if the hosts offer to pack up food to go, guests can gratefully partake. Otherwise, asking for a doggy bag because the food was 'expensive' just seems crass.