The country of origin for the MiG 28s (see footnote) was left intentionally vague. It would have been easy to have the pilots converse in their native language or even adorn the aircraft with unequivocal identification schemes.
That the enemy was never officially established in Proser's early draft or Jack Epps Jr's final script. This was likely intentional: villainous governments in the movies are routinely left vague as to not piss off their real-world counterparts, with the exception of North Korea, possibly because North Korea doesn't have a strong market for movies or video games.
source: Task & Purpose - Brad Howard
Regarding their identification markings:
However, the markings on the fictional MiG-28 aren't Soviet. The MiG-28 in the film has a single red star surrounded by a yellow circle on their tail as their only marking, while Soviet aircraft traditionally had a white trim to their red star (just to cover my bases, the North Korean Air Force uses a blue trim). However, one country does, in fact, use yellow trim on their red star insignia: China.
source: Task & Purpose - Brad Howard
At least one of the script's draft identified the aggressors as North Korean.
Despite the markings, North Korea is still a good guess. Producers Jerry Bruckheimer and Don Simpson had more than one writer working on the Top Gun script. Along with Proser's draft, Jim Cash and Jack Epps, Jr. were hired to write another draft of the screenplay for the film that initially identified North Korea as the threat that Maverick and Co take on in the thrilling finale.
source: Task & Purpose - Brad Howard
During script rewrites, the conflict was moved to the Indian Ocean which further confuses the issue. Which nation sporting MiG28s supposedly armed with French made AM 39 Exocet anti-ship missile(s) would be so protective of that area?
So there is no definitive country of origin.
Apparently, the fictional MiG-28 aggressor aircraft used in the Top Gun film were actually a mix of Northrop single-seat F-5E Tiger II and two-seat F-5F Tiger II aircraft.