Generally the OEM manuals will provide tables etc., to determine this.
Two considerations -
(a) will it fit through the opening head on ? Simple 2D geometry but not usually limiting
(b) will it fit through the opening at an angle and then not jam on one or more internal surfaces .. gets a little more complex in the calculation but not horribly so.
Overall, there is not going to be a simple number cruncher to get the answer so, either you hunt down (or measure) the 3D profiles and do the relevant geometry .. or read the OEM bookwork which describes the results of the same work previously done by the OEM.