I am repeating my answer in plain text as oppose to tags and on my main here instead of in my reblog blog to spread my opinion;
Hi there! I have watched both shows to completion and have also spent a probably totally completely normal and average amount of time thinking about this hypothetical.
In terms of skill and experience, Stanley and Stanford outclass Perry and Doof.
Stanley has fought in fistfights against dangerous wildlife, paranormal creatures/cryptids, humans, government officials/spies, AND has broken out of prison at the very least 3 times in his lifetime. Stanford is a whiz with technology, was able to figure out what many generations before him destroyed in order to bring an eldritch entity into his world's existence, PERFORMED SURGERY ON HIMSELF, got teleported to THE NIGHTMARE DIMENSION (survived!), and was able to create what other scientists thought impossible for a science fair project. The two of them, combined effort, DEFEATED BILL CIPHER, an otherworldly eldritch dream demon entity. They're also incredibly old, and have been dealing with shit like this for more than 60% of their lives at this point.
If I had to pick who would win, it would definitely be the Grunkles.
THIS IS NOT to discard the repertoire of Dr. Doof and Agent P. Yes, both Dr. Doof and Agent P have similar strengths to the Grunkles.
Dr. Doof is also the braniac archetype- however what separates him from Stanford is the fact he has the brains, but no brawn. He's not entirely defenseless alone- but without his machines, and against Stanford? It wouldn't be a fair fight. And let's be honest here- his machines have a self destruct button. It will get destroyed before Stanford breaks a sweat. Traps are also something that Stanford is able to forsee, in my honest opinion. Yes he could definitely get caught in one, but he'd figure out how to break free pretty easily.
Dr. Doof would be able to capture Stanley, but Stanford would be quick to aid him.
Perry, Agent P (tomayto tomahto), would put up a really good fight against Stanley. But you also have to remember- Stanley's fought against both government officials, spies, AND feral to domestic to sentient animals- MULTIPLE TIMES may I add. This platypus is a spy? Bring on the fight. He'd probably take him down eventually.
I want to drive this point home
Dr. Doof would pull out an inator, Stanford would dodge it, then ask "Incredible! How did you manage to make this brilliant work of engineering?"
To which Doof, who has very few people take genuine interest in his machines as we all know (besides Perry and OWCA), would proceed to go "Wait, you're actually interested in how I made this?"
The rest of the episode would consist of the two going off this tangent and talking about marvels of science, engineering, and each other's research.
Meanwhile, Stan and Perry would probably wait for them to finish and play poker or go fish or something.