If a flame sphere is moved on top of both characters, they both take damage. As damaging area spells don't make a difference between friend or foe (unless said so on the text).
The rule about a grapple trying to force the grappled target into a dangerous area doesn't apply here because the spell was moved by someone outside the grapple.
If a flaming sphere or an aggressive thundercloud were moved into the NPC's space, does the spell's effect affect only the NPC or does it affect both the NPC and the PC?
If the NPC is inside the effect's area but the PC is not, only the NPC takes damage.
Both spells mentioned affect only a single square (5-foot diameter sphere), so anyone within 5-feet of the sphere should be safe, unless they move inside the spell area.
If the PC pinned the NPC (making them occupy the same space), would both be hit by the spell's effect?
Yes, they are both inside the effect, unless the text says it doesn't affect allies of the caster. Flaming sphere targets a single square, as i mentioned, and since the grappler and target are in the same square during a pin, they both are affected.
Unless the grappler is larger than the target, which means the target occupies only one of the squares (or part of their area for huge vs large grapples, or larger creatures).
Do the grappling PC and NPC make Reflex saving throws normally?
Yes, grapple doesnt prevent you from making reflex checks. But you take a -2 on your reflex due to the -4 penalty on dex from the Grappled Condition.
Though, if the spread or attack originate from the other side of the grapple, you do have cover and should benefit from a +2 on your AC and reflex saves.
Cover and Reflex Saves
Cover grants you a +2 bonus on Reflex saves against attacks that originate or burst out from a point on the other side of the cover from you. Note that spread effects can extend around corners and thus negate this cover bonus.
Does the pinning PC and the pinned NPC make Reflex saving throws normally?
Same here, you can always roll your saves, even if paralyzed or unconcious, thought if you are paralyzed or helpless, you have 0 dex and take a -5 penalty.
A Helpless target (unconcious, bound, paralyzed, sleeping) is still allowed a saving throw.
All saves are a reflection of ability, experience and sheer luck, and you are nearly always allowed to make a save to resist an effect.