Welcome to the West Coast!
This is a great backbone of an itinerary. We love San Diego and have done it both before and after. If you want to be fresh and pre-theme park tired, it’s good to do that first. But also, the San Diego parts (well unless you’re planning to do the zoo in one full day and will walk it all over) are more chill than a DLR theme park day. So you can put it at either end of DLR and it will work.
As for LA, it is always cool to see once and I do recommend fitting it in if it’s of interest. But me personally, I am of the opinion that the less time I spend in LA, especially the center of Hollywood, the happier I am. It has some very non-glamorous aspects and hands-down no question you are better off with a car (or taking an Uber/Lyft between point to point) because it is not a walkable or public transit friendly city AT ALL.
They have tour bouses that I feel are a good way to see highlights of it generally, including some celebrity houses, walk of fame, Hollywood sign, Chinese theater, etc. if you’re at all interested in that. The WB studio tour is always a popular item to add to the itinerary. @LTinNC82 did a couple of days of tours in LA that I remember she loved and looked like a great overview, so tagging her to chime in on what that info was.
I think Griffith Observatory is also worth a peek if you like art museums and the views from it are great, but may be a skip for you with the kids and limited time. They would probably prefer the Tar pits and Natural History Museum. My kids quite enjoyed the Grove Mall and Farmer’s Market next to it, but we are a family that likes to shop, even just window shop/browse and the Farmer’s Market was not at all what I expected of a Farmer’s market but more like established outdoor restaurant stalls and had just about every kind of cuisine you could imagine and was an amazing place to get food for dinner after shopping our way through the Mall (we had gone specifically for the American Girl Store that is no longer there, sadly).
And there are some renowned beaches in the LA area (Malibu & Venice) but I prefer Huntington and Newport which are closer to Anaheim (Long Beach is also somewhere in between and has been on my list to try to visit plenty of trips now and we still haven’t made it). We also did a great beach in San Diego (Coronado). So there’s plenty of beach to see other days if you want to focus more on LA proper when you do that.
There are a couple of options here. Finding a safe, clean hotel in LA that will not break the bank is a chore. I give up every time I look for one, so unless you are willing to fork out the extra $$$ for it, I tend to find it’s slightly easier to stay in Anaheim and just plan around the traffic into LA. YMMV if you are flying out of LAX after the LA portion and in that case, you can potentially expand your search up towards LAX/Burbank and that might give you more options that you like.
You can Uber/Lyft from Anaheim into LA as I mentioned above but if you wanted more sure transportation you can rent a car. There is a Rental Agency at the Pixar Place hotel onsite at DLR and another location on Katella Ave right near the Convention Center that might be closer to you if you stay at an offsite hotel along Harbor Blvd. If you get the car just to get LA & drive around LA, then you won’t be at the whims of an Uber/Lyft without (easily accessible) public transportation options. And it’s likely cost-efficient to rent the one car vs. taking Ubers into LA and then between any destinations within the city and then back out to Anaheim.
One last thing on having a car, the drive from Anaheim to LA can get grid-locked at rush hour (6am-8 or 9am and (2pm- or 6pm) and can still be busy (but at least moving along at some other pace) throughout other waking hours. So just another consideration on if renting a car vs. Ubering to LA will be the better route for you.
And now that I typed that, I wondered, would you be renting a car for the San Deigo portion and be getting up to Anaheim in it? If so and you don’t want to keep it during the DLR days but still want to do both San Diego and LA I might re-work the itinerary so that you come into LA, then drive down to SD spend the 2-3 days there and drive back up to Anaheim, turn in the car, do DLR and Uber to the airport at the end (and you can check flights and prices from any Orange County or LA airports including Long Beach, SNA, Ontario, Burbank and LAX).