The USSR famously took ownership of Tetris away from its creator.
He developed the game on company time. If he'd lived in a capitalist country, the government wouldn't have taken control of Tetris, but the company would have. Every software company contract I've ever heard of has a clause that says the company owns any code you produce while working there.