Alternatively, you can aid a friendly creature in attacking a creature within 5 feet of you. You feint, distract the target, or in some other way team up to make your ally's attack more effective. If your ally attacks the target before your next turn, the first attack roll is made with advantage.

Can an actual attack instead of a feint be used as the distraction for a help action?

For example:

P1 and P2 are facing a monster M1, with initiative order of P1, P2, M1.

P1 declares he wants to use his the "Help Action", but wants to use an attack as the distraction.

P1 attacks, and succeeds. P1 proceeds to deal damage.

P2 makes his attack with advantage.

Is this allowed? If so, how would the mechanics work? Would P1's attack even need to be successful to sufficiently distract the monster? Is this a "loophole" in the Help Action?

Your example

P1 and P2 are facing a monster M1, with initiative order of P1, P2,
M1. P1 declares he wants to use his the "Help Action", but wants to
use an attack as the distraction. P1 attacks, and succeeds. P2 makes
his attack with advantage.

P2 does not attack with advantage. P1 used his Action in Combat to Attack, not to Help.

If the PC takes the attack action, the Help action isn't an option on that turn unless a reaction or bonus action class feature/spell allows the help action to be applied as a reaction or bonus action.

The Rogue (Mastermind) has a feature that offers one ally advantage.
The Battle Master Fighter has a similar Maneuver that provides
advantage on one ally's attack.

The attack action is a complete turn spent try to make a successful attack. It isn't just a swing of the sword, it is six seconds of dedicated action trying to land an effective blow. The d20 roll determines if the combined efforts succeed, or not.

The feint is just that: a distraction that is never intended to land a blow, but rather make it more likely that an ally lands a blow.

Pack Tactics - a game feature that does this

I feel that it is worth mentioning that there is a game feature that provides the effect wihtout trying to use Help to do this. If the PC is playing as a kobold PC(ref: Volo's Guide to Monsters), and both P1 and P2 and they are within 5' of M in your example, they each give each other advantage on their melee attacks against M. There are a substantial number of monsters who also have this special feature: examples include wolves, dire wolves, and kobolds {monsters/NPCs} (Basic Rules pages 159, 123, and 142 respectively.

Pack Tactics. The kobold has advantage on an attack roll against a
creature if at least one of the kobold’s allies is within 5 feet of
the creature and the ally isn’t incapacitated.

Another way to grant fellow combatants advantage on their attacks is by using the optional flanking rule from the DMG (p. 251). This puts the onus on your example P1 and P2 to use movement such that they are in positions to flank M.