Aguero, 32, is set to leave Manchester City this summer when his contract at Etihad expires.
The Argentina international is believed to be considering a move to Barcelona, where he could link up with compatriot Lionel Messi.
But he has also been linked with Man United, Chelsea and Paris Saint-Germain recently.
However, speaking about Aguero during his pre-match press conference ahead of Man United’s Premier League clash with Brighton on Sunday night, Solskjaer opposed any player moving across the city.
“I would not expect any player who has played for a club for ten years to want to go to their local rivals,” Solskjaer said.
“It is not for me. I know we’re professionals, but when you play for Man United, you don’t go to Man City. We have had examples of that, and I didn’t really agree with it. I won’t name names, but you all know who I mean. Enough said.
“When I played for Man United if a rival club tried to sign me, and I had gone – well, where’s the loyalty? Loyalty is one of the values I really, really put highly.”
Meanwhile, the last high-profile players to move between the two Manchester clubs were Carlos Tevez in 2009 and Owen Hargreaves in 2011.