There are several strategies.
- You could sample the hemisphere (according to the local material's brdf) liek any other bounce, and pray that the light escapes to the sky (if the ray extends to infinity, sample the skybox in that direction)
- You could sample the entire skydome, using its luminance as a probability distribution function
- You can (as you stated) sample the only parts of the geometry that allows a ray to escape, should you know that there are some (could be windows if you know your are indoors, but if you don't, you'll have a hard time selecting where to send your rays)
All three methods have their uses. If you know you have windows (and you know them all) then sampling the window shape and extending the ray to the skydome should be quite efficient.
If you're not always indoors or don't know what is or isn't a window, then the other two methods are much more general. Since the sky provides quite directional light, it would make sense to sample according to skydome luminance.
I'm a fan of hybrid methods, so I'd let the brdf decide: If it is very narrow/specific (like specular of glossy) then sample according to brdf. If brdf is broad (diffuse) then use window sampling if indoor, or skydome luminosity sampling when outdoors.