Allowed distance between service entrance and breaker box
The NEC simply says as close as practical. Some locations do impose an actual distance number. Most areas have a limit of 5-6 feet into the structure to the main panel/disconnect. 

Your local authority/inspector will be the only one who can tell you for sure.