There are a couple of ways:
1. Create different vias, one type with and one without a soldermask pad built in. You would have vias not selected on the Top and/or Bottom layer, but would have them selected on the Soldermask layer(s).
2. Designate the ones you want to have soldrmask as test points (I guessing that's what you're doing this for anyway). Then in the soldermask setup in CAM, choose Test Points as one of your active items, either on the appropriate routing layer or the soldermask layer. This works with or without a soldermask pad assigned.