No - it's a pain in the bum, tbh.
Classrooms don't have a large knife to cut it with and plates or serviettes to try to catch crumbs (which are always going to go on the floor).
Then there's allergies you need to be aware of, and, quite frankly questionable hygiene from some houses - but you couldn't accept off someone then not off someone else.
Then there's healthy schools policies, or parents that just don't want them munching cake.
IME, 'taking a cake in' isn't allowed at most schools for all the above reasons, so your dh is right.
Some schools apparently still allow a bag of sweets or something, but, again, a lot don't these days. A good thing IMO too - I don't think parents should feel pressured to be sending in enough sweets to feed a class.