Open or exposed vias are never put in BGA pads. However, it is permitted to place them between the pads if a complete solder mask dam is inserted between the pad and the via. You can also instruct your PCBA assembly house to fill and plate the vias, but only use metal on the PGA pad.
You have more flexibility when using other types of components. But you have to make some choices and follow accepted guidelines. Let use consider a large part, such as a voltage regulator, where the vendor advises to connect vias to the thermal pad in the ground plane, or on the back side of the board in the thermal area. For this application, it is similar to the way a QFN is treated; read our recommendations regarding that type of package.
In applications where you have a lot of room, which gives you flexibility, if you have exposed vias, you may experience that solder is pulled to the reverse side of the board. This is okay if the vias are very small. However, this is not a wise practice.
Your choices come with pluses and minuses. For example, some manufacturing engineers recommend that a via should never be filled or capped because it would inhibit the transfer of heat. Conversely, power component vendors say you should not use an un-manufacturable design to meet product design requirements. The best choice is to cap the via with solder mask, but make it as small as possible (i.e., 100-125 microns bigger than the via). You should section off the paste stencil layer in segments. Remember, problems may occur if solder paste is placed on top of an exposed via or masked via.