According to the National Electrical Code (NEC), service entrance cable is permitted to be used both inside and outside of a building. However, the cable must be installed in accordance with the NEC’s requirements for the specific location and application. For example, if the cable is installed outside, it must be protected from damage by sunlight, moisture, and other environmental factors. If the cable is installed inside, it must be terminated within 5 feet of entering the building. The NEC also specifies that service entrance conductors must be installed in a readily accessible location either outside of a building or structure or inside nearest the point of entrance of the service conductors.
Hope this helped :)