By the time both of these movies came out, imports of Soviet-designed guns had started to make their way onto the US market, so guns like AKs weren't too difficult for a movie to get its hands on as long as they weren't looking to get fully authentic Soviet guns. China's Norinco would be a major source of Soviet clones (SKS, AK, and SVD) on the US market up until they were banned from import in the 1990s, and there existed countries like Egypt, Hungary, Romania, and Finland from which some AK-derived guns could make their way onto the US civilian market.
In Red Dawn, they used imported Egyptian Maadi AK clones, with a few guns modified with AK-74 muzzle brakes to stand in for AK-74s. A Valmet M78 stands in for an RPK fairly well, as Valmets were Finnish guns that could be imported at the time and looked close enough to an RPK to pass for the average moviegoer. At least one other Valmet chambered in .308 laid out similar to the M78 Valmet was used in several promotional shots, but doesn't appear to have made it into the movie. M60 parts were used to make mockups of several Soviet machineguns for the movie, as no examples were readily available.
In Rambo III, they largely had a combination of authentic Soviet guns and imported Chinese guns, the latter of which were often modified for particular looks. Part of the filming took place in Israel, where they were able to take advantage of the supply of authentic captured Soviet small arms - mainly AKMs - along with a few other pieces like a DShK heavy machinegun. Other shots used imported Chinese Norinco guns - Type 56s for the AK variants and an NDM-86 for a sniper rifle - as those were readily available on the civilian market in the US at the time. Some guns in particular are Type 56s modified to look like an AK-74 with its distinct muzzle brake, as even Western militaries were having a hard time getting their hands on the guns at the time, let alone the civilian market.