Bus came to me at 4 already neutered. His previous owner had him done at around 18 months because he was becoming "territorial". I would have had him neutered anyway, as there are some health issues (like perianal hernias- yuck!) that mature intact males are definitely more prone to, and I generally feel that altered males tend to be better (easier? <shrug>) "pets". I prefer female dogs, but if I were to get a young unaltered male, I'd probably do it anytime after 9 months, trying to hold out til around a year for a larger breed (not going to have a giant breed anytime soon, so talking 70 lbs or less).
Annie was spayed around 2, that was when my aunt (who was her owner then) agreed to have her done. She had been considering breeding her, but was in no position to do that, and Annie was living with us at the time. She'd had a couple heats prior to that.
My grandparents' dog is currently living with my parents, and I had her spayed at around 7 months. They were having issues with her escaping and cruising the area around our houses (no fence), she's a small dog, and they had no use for an intact dog. She's a funny looking dog, but no more so than her (still intact) parents.
Previous larger dogs (APBT) were spayed at around 8-10 months, one after her first heat, one before. The first dog had no related issues, second dog (who was also diabetic) had some occasional incontinence as an old dog, primarily when her glucose got high and she was drinking a lot. Both were "ok" structurally, no better or worse than the average for their breed. The dog who was altered after the heat was leggier, FWIW- I chalk that up to breed variation.
I would probably still aim to spay a female dog I obtained as a pup prior to her first heat, as I just don't want to deal with it. If there were specific structural or behavior concerns, or if it were a breeder purchased dog and they wanted to wait, I wouldn't be against waiting until after a heat, but in general, my personal taste would be to try to do it around 8-9 months, and hope they didn't come in before then. I wouldn't keep a female dog intact for life unless they were at high risk for surgery complications, not only because it's a pain in the rear, but also because of the risk of pyo and mammary tumors. I think mammary tumors are a bigger concern with cats, as a higher percentage of them are malignant in cats, but still, they're both things that tend to occur in older dogs that tend to be less than ideal surgical candidates.
My cats were all spayed at around 7 months. I wanted to wait as long as possible, but avoid them coming into full blown heat, as I was very concerned that with 3 females, it'd cause a behavior problem between them. I had nightmares about the feral cats outside spraying my doors/windows
. Plus, cats in heat are off the hook!