I'd say that's overly expensive and complex. Since almost everything with these companies is about the ad selling, harvesting and using the data and tieing the users attention. The state would adopt something that is mostly concerned with that. And they'd struggle with their role influencing political views with the algorithms that now belog to them. And it'd be pretty much an Orwellian dystopia once the state starts getting into the advertisement business. What we consider a "product", the social media platform or mail service is just a means to have users. It's a tiny fraction of what these companies do. And it's an expense to them, not what they make money with.
I think it's far easier and quicker to start fresh. Have something that has good features baked in from the start. And not adapt a business, settle >90% of what it's about and change the product 180 degrees so it's about something entirely different. I mean everything Google programms is with the idea in mind to sell ads. They'd need to change pretty much everything about that program code. And we already have some good alternatives to some things. And the EU for example already funds some Free Software. I think if we were to educate people, regulate online services in a good way and offer proper alternatives, the rest follows automatically. IMO nationalising an ad selling business comes with severe issues, as I lined out earlier. And if we did it over, we could also learn from the past and address issues like filter bubbles, unhealthy behaviour, being overly addictive and whatever is baked in to the current generation of social media and almost impossible to get rid of.