I have a door rough opening and it isn't square but the sides are level and the top is almost level. I am installing a prehung door and it fits inside the rough opening but it doesn't have an even gap all the way around. Will this be functional and code-compliant after I shim it in?
It's quite common for a rough in to be slightly off square. As long as you shim it properly and anchor it securely, there won't be a problem.