There is no reason at all---from an installation point of view---why a dishwasher must be under or near a sink. You can put your dishwasher anywhere where you can hook it up to your water and electrical supplies and a drain.
There are, however, some good practical reasons related to the way you use your kitchen and the way it is laid out for placing your dishwasher next to your sink.
Ease of Installation
While it's true that there's no physical reason why you should not install your dishwasher in your laundry room, or even in the bathroom, it is probably fair to say that you really want it in the room where your dirty dishes are---that is, your kitchen. Anything else would be more or less inconvenient. Given that this is so, there is one place in your kitchen where you are certain of having both an easily accessible water supply and a drain. That place is under the sink.
Ease of Use
Locating your dishwasher under or next to the sink also wins out in terms of convenience of use. When you load your dishwasher, you almost certainly do it via the sink. In other words, you rinse plates, silverware and other dirty items under the tap before placing them in the dishwasher. Most people also store dinnerware and other frequently used (and frequently washed) items near the sink. If you put your dishwasher somewhere else, you will end up having to carry things around a lot more. It will be less efficient.
Just because next to or under the sink is generally the best place to put your dishwasher, you should not despair if you cannot fit it there. Put it somewhere else in the kitchen. As long as you can run the water supply to it and can drain it properly, it will be fine. It will be a little less convenient to install and use---but it will still be better than no dishwasher at all.
If you have a small kitchen and cannot fit a full-size dishwasher, consider a half- size one instead. It will have the added advantage of costing less to run.
To decide if your dishwasher belongs under or next to the sink, ask yourself:
-Is there enough space for it under the cabinet in that location? -If installed there, can I open the door without hitting other cabinets or handles? -Is there a location in which it would be clearly more convenient, to which I can run a water supply and from which I can run a drain?