How to get box collider detection by Ray cast only from the outside of the box collider

All I want is my player to be able to detect an object (base) only from the inside

Did you make a typo the first time? you first said in the title you want to check from outside and then you said from the inside. Whatever it is, afaik you can only check from outside. If your game is 2D you can use
Physics.Raycast2D Unity - Scripting API: Physics2D.Raycast
Or if it’s 3D use Physics.Raycast or even linecast: Unity - Scripting API: Physics.Raycast

If what you want is to detect if your player is inside a “base” then why not define a collider for the whole base and then check OnTriggerEnter/ OnTriggerStay (depending on what you need) from the base object.
I need more information to give you a more appropiate answer.