From what I am envisioning of your description, that the cabinets are built-in and the back of the base cabinet IS the wall covering, that there IS drywall in the space between the base cabinets and the upper cabinets, and that the back of the upper cabinets IS the wall covering, and that there IS drywall in the space above the upper cabinet ... and that the wall is an interior wall and not an exterior wall ... and that this is likely an very old house ... there was nothing in the code prohibiting that, however, with modern cabinets which come in 'boxes' which mount together or pre-custom made sections which are simply attached to the wall - what you describe would be a VERY unusual practice and one which, while maybe not being prohibited by the code would certainly expose a VERY CHEAP builder who would cut each and every corner they could find ...
As you can probably tell, I do not have enough information to make an informed answer so I am throwing ideas out based on what you might have.
If it is a new(er) house, I seriously doubt that would ever pass plan review or inspections.
If an older home with cabinets custom made on the site for that specific home, I can see that happening back in the 1940s and earlier.