Cubemaps don't have to be powers-of-two in size, but they must be squares. So they can't be sized "depending of the viewport". And there's no reason for them to be either.
If you're trying to make an environment map, then the size of the texture should not be dependent on the exact size of the rendered image. You probably want to scale up the texture with higher resolutions, but you don't want the environment map to match the destination image size.