Technically, yes you can install two different sized subs in the same box. For example, let’s say you are making your own box and already have a 15” subwoofer and a 12” subwoofer. Rather than going out and buying a second woofer that matches one of those sizes, you might think about just installing the two different subs in that new box you are fabricating.
If you make the appropriate cutouts you can install both sizes. The main question to consider is should you actually do so and what impact having those two different subs will have on your box’s performance.