This can be OK if you consider and address the consequences carefully. It's something I would only do as a last resort. Usually I try to make sure the hole itself is outside the outline of the pad, and therefore covered with soldermask.
The major problem I see is the via making a thermal connection and slowing down the temperature rise of the pad. This can lead to "tombstoning".
Tombstoning is when one pad of a small 2-pad part heats up before the other so that one has molten solder on it while the other still has unmolten solder paste. The surface tension of molten solder is much higher than that of paste. The high surface tension on one end of the part can cause it to lever up, making it stand vertically on one pad and no longer touching the other. That's why it's called "tombstoning". The part sticks up, like a tombstone does from the ground.
For tombstoning to work, the part has to be small. The part acts like a lever. When the lever is too long, the force to lift the part off the far pad is higher than the surface tension can provide. Generally 0805 are safe from tombstoning, but anything smaller than that is susceptible. At 0603 you have to consider it. Tombstoning can happen readily at 0402 size.
The other thing to worry about is the surface tension of the molten solder pulling the part off-center when the solder on all the pads is melted. This can largely be countered by making sure the solder mask openings are the same for all the pads. You can have more metal leading off some pads than others, but if the solder mask openings are the same there won't be any differential pull from the surface tension.
So, when possible, put the hole of the via far enough away from the pad so that it is covered by solder mask. Only put holes abutting pads when the parts are large enough or have enough pads to prevent tombstoning.
In some cases when you're really space-constrained, put the via in the middle of the pad. Some solder will go down the via, but of course the pad and pin of the part will wick solder too. There should be enough left to allow for a firm connection. However, this is something you should discuss with your assembly house. They know their process better than you do. Tell them what you want to do, and see what they think. If you're not using a lot of small (< 0805) parts, maybe they'll apply a little thicker layer of solder paste. Again, though, this is something where you let them tell you what to do to work well with their process.