You can disable selection for everything in viewport by Select/Selection Filter/None or restrict only on nulls, splines, polyobjects etc.
Or as I said, disable all, but create Selection Object first, add objects inside what you want to access in viewport. This way cann´t be selected nothing in viewport, but opening Selection Object in Object Manager and clicking/selecting object from list you can manipulate in viewport...
If I may ask, why you need this behaviour?