Quagsire has always been a competent defensive Ground-type. However, it's generally not thought of as a top OU Pokemon because its ability to counter Hidden Power legends was not needed when they were banned and because it's a lot less offensive than other Ground-types. However, in the modern metagame where the legendary Electric-types regularly carry Hidden Power, Quagsire's neutralities to Ice- and Water-type attacks give it a unique defensive advantage over other Ground-types, although the uncommon Hidden Power Grass can still be used to ruin it. Quagsire is a decent mixed wall that can threaten to sweep if given the chance to set up a Belly Drum, but unlike other Ground-types such as Nidoking and Marowak, it doesn't have the attacking stats to pose an immediate offensive threat.
You can thank Raikou, Zapdos, and the fairly recent (circa 2009) unbanning of Hidden Power on these Pokemon for Quagsire's emergence as a legitimate threat in GSC OU. The most common Hidden Power types used by Zapdos and Raikou are Ice and Water; Quagsire is neutral to both, which gives it the edge relative to other Ground-types that might be used to check Electric-types. It should be noted that Hidden Power Grass, while hypothetically possible, is rare and leaves the legendary Electric-type Pokemon vulnerable to Nidoking switch-ins.
Quagsire walls these Electric-types impeccably, but it also serves as a fantastic mixed wall for threats such as Tyranitar, Dragonite, and Nidoking. Quagsire is also a solid check to Tentacruel, and at decently high health, it can survive a 999 Attack Charizard Earthquake and KO back with Hidden Power Rock. Because of its important defensive capabilities, Rest is recommended on Quagsire so it can keep switching in to wall what it can.
However, while Quagsire's walling capabilities are certainly handy, decent mixed walls such as Raikou, Suicune, and Miltank are a dime a dozen. What truly makes Quagsire stand out is its access to Belly Drum. With Belly Drum, Quagsire can threaten to sweep the opposing team, something the aforementioned mixed walls cannot boast. Furthermore, it's capable of setting up Belly Drum safely in the face of the ever-present Hidden Power Zapdos and Raikou, something even the mighty Snorlax cannot accomplish. STAB Earthquake is the main move Quagsire will be using after setting up. Meanwhile, Hidden Power Rock hurts the Flying-types that are immune to Earthquake. After a turn of setup, Hidden Power Rock can OHKO Zapdos and 3HKO Skarmory, one of Quagsire's most prominent checks. It should be noted that unlike other offensive sweepers such as Snorlax and Marowak, Quagsire isn't capable of threatening much of anything without a turn of setup.Team Options & Additional Comments >>>
A more defensive variant of Quagsire could be built by replacing Belly Drum with Curse. This would allow Quagsire to force out mixed attackers and force the opponent to send walls rather than offensive threats into Quagsire without having to rely on the difficult-to-use Belly Drum. This is important because a Quagsire hovering around half health can't threaten to set up Belly Drum, allowing a threat such as mixed Snorlax to switch in and take the initiative; on the other hand, Curse Quagsire would be able to easily deter this switch-in. A more defensive Quagsire could also use Haze in Belly Drum's slot. This would prevent Baton Pass users, most notably Jolteon, from transferring their boosts to another Pokemon while also neutralizing Curse users and stopping Belly Drum Snorlax sweeps. When using Curse or Haze, Sleep Talk can be used over Hidden Power Rock. Hidden Power Rock's main use is allowing Quagsire to KO Zapdos and Skarmory after a Belly Drum, so without Belly Drum, that slot would be better suited toward a more defensive move. Note that if Belly Drum is dropped, even for Curse, Quagsire is not going to contribute much of anything offensively because too many Pokemon shut it down entirely.
In addition to more defensive sets, Quagsire could forgo Rest and run an all-out offensive Belly Drum set. Generally, Sludge Bomb is selected in place of Rest to give Quagsire a powerful move to use against Exeggutor. Even before a Belly Drum, it does quite a bit of damage to Exeggutor and threatens to poison it. Generally, an all-out offensive Quagsire will be used alongside Pokemon such as Jolteon and Smeargle that can pass Agility boosts, thereby negating Quagsire's lackluster Speed and allowing it to set up a sweep legitimately.
Another possibility is using Quagsire's special attacking movepool. Surf is generally a poor move choice, but it can help check Rhydon more effectively and instantly threaten solid damage against Skarmory (30% - 35%). Note, however, that Surf still fails to 3HKO Skarmory. Ice Beam is another option; it's a decent attack for instant damage against Exeggutor switch-ins, and might also be useful for attempting to freeze a key Quagsire check such as Skarmory or Suicune. Generally, though, Quagsire shouldn't be using even STAB special attacks because its Special Attack is very poor.
Checks and Counters
Skarmory is the chief Quagsire check, safely avoiding a 3HKO even from Quagsire's STAB Surf and comfortably phazing Quagsire after it has used Belly Drum (999 Attack Hidden Power Rock does 40% - 47% to Skarmory). Any other attack does pitiful, insignificant damage to Skarmory. Exeggutor is another potent check; although it fears Sludge Bomb, it switches in on Earthquake and Hidden Power Rock with impunity and threatens to KO with Giga Drain or Psychic. Meganium stops Quagsire even colder than Exeggutor does; it has better defenses, an instant recovery move in Synthesis, and unlike Exeggutor, isn't picked off by Pursuit Tyranitar. However, Synthesis's mere 8 PP erodes quickly, and Meganium is no fonder of taking a possible Sludge Bomb poison than Exeggutor is. Heracross is a potent Quagsire check, too. It resists Earthquake and is neutral to Hidden Power Rock; furthermore, it boasts a powerful Megahorn that threatens to 3HKO Quagsire. Thus, the presence of a medium-to-high-health Heracross effectively prevents Quagsire from using Belly Drum safely. Suicune is another strong Quagsire check, though it needs to be at high health and avoid paralysis if it is going to perform this function competently. Its Surf 3HKOes Quagsire, and if it switches in at full health as Quagsire uses Belly Drum, it KOes Quagsire with Surf before Quagsire can KO it with Earthquake. Cloyster is a decent check; while it can't 3HKO with STAB Surf or Ice Beam, Cloyster has the Defense to survive a 999 Attack Earthquake and hits hard enough with its STAB moves to 2HKO Quagsire after it uses Belly Drum. Marowak can serve as a check if you predict Belly Drum. Quagsire is one of the few Pokemon Marowak outspeeds, and a Thick Club-boosted Earthquake does a minimum of 53% to Quagsire. Thus, Marowak can threaten to KO Quagsire if it sets up Belly Drum on the switch-in. However, Marowak is an unreliable check, as switching it in on an Earthquake can render it unable to survive a hit such as Hidden Power Ice from Zapdos later in the match.
If you can reliably keep Spikes down, you can use anything with a strong STAB Surf, such as Starmie or Vaporeon, to effectively trade with Quagsire. Although these Pokemon fail to OHKO Quagsire after a Belly Drum and are OHKOed by a 999 Attack STAB Earthquake, they can lower Quagsire's health to dangerous levels if it decides to go for the KO, thereby leaving it unable to switch back in easily. This, in turn, can open up your own Zapdos or Raikou for an offensive push. However, without Spikes, it becomes much more difficult to handle a possible Quagsire switch-in, so in the event that you cannot keep Spikes down, you should only use these frailer Water-types as Quagsire counters if it has enough residual damage to be put in KO range after a Belly Drum. Of course, anything with a Grass-type attack that isn't weak to Earthquake makes a solid Quagsire counter; even with a Ground-type weakness, having a Grass-type move can catch Quagsire by surprise and ruin it for the rest of the match. However, Grass-type moves are generally not very useful outside of countering Quagsire, so other means of checking Quagsire are preferred.