Only if you want to reduce the available size. If you want more storage, this doesn't work. It's also not automatic for newly placed containers.
E.g. a cargo wagon stores 40 stacks. It's 12 times larger than a steel chest but holds less than a single steel chest. It ought to hold 576 stacks at a minimum, and it is impossible to achieve this with your suggestion.