You could scale it relative to the Screen dimensions:
public bool showBox = true;
void OnGUI() {
if (showBox) {
var marginX = Screen.width / 10; // Fill most of the screen but...
var marginY = Screen.height / 10; // ...leave a 10% margin on each side.
GUI.Box(new Rect(marginX, marginY, Screen.width - 2 * marginX, Screen.height - 2 * marginY),"test");
// The close button is 100x40 and centered at the bottom of the screen:
if (GUI.Button(new Rect(Screen.width / 2 - 50, Screen.height - marginY - 40, 100, 40), "Close")) {
showBox = false;
}
}
}