Can a garbage disposal handle waste from both a sink and a dishwasher?
Many disposals have a specific connection for a dishwasher. If yours has one you can use that, or if you haven't bought one yet, look for a model with that feature.



Note: This may no longer be up to code in your area: see Why does my dishwasher back up into the sink, but running the disposal allows it to drain?



That said, many dishwashers have macerators built-in, which is effectively the same thing. I'm not really sure how useful it is to have a disposal downstream anyways. A dishwasher has to pump the waste water up to the drain. If you have anything in there that the disposal would actually chop up, it's probably going to jam the dishwasher pump before getting to the disposal anyways. In fact, this is why dishwashers have strainers and built-in macerators to begin with.

If you're still intent on having the dishwasher go through the disposal, and you don't have a built-in macerator or a dishwasher inlet, then it's just a matter of physical space. Can you fit a connection for the dishwasher between the disposal and sink? (although again, note this may not be up to code anymore).

If I had to choose only one, I would definitely choose sink. Most dishwasher drain hoses are 5/8" -- anything that doesn't clog that isn't going to clog the 1 1/4" sink drain. (I'm not sure if there is some other motivation for doing this besides avoiding clogs, though?)