An oven can also be used to dehydrate things (in addition to the sun).
Most grills can do some light smoking as well (an aluminum foil pouch full of wood chips placed on the charcoal can work in a pinch). However, the the low temp, long cook isn't something a grill can do well as they typically don't permit adding more fuel to maintain temp while in use (not to mention they generally aren't designed/constructed to hold a constant temp for long either).
As for which to buy it might be worth trying each process with what you already have in order to see which you prefer. Though given the multiple alternatives to dehydrators, and the limitations of grills for replacing smokers I'd personally lean toward getting a smoker (preferably something like a ceramic grill/smoker/oven with multiple uses) first. ...but that's just me and that could vary depending on what a person wants to make more..... (not sure how much smokers can do much for preserving fresh fruits or vegetables).