Yes, Parry can reduce any kind of melee attack damage
Heavy Armor Master says:
While you are wearing heavy armor, bludgeoning, piercing, and slashing damage that you take from non magical weapons is reduced by 3.
Parry has this effect:
When another creature damages you with a melee attack, you can use your reaction and expend one superiority die to reduce the damage by the number you roll on your superiority die + your Dexterity modifier.
If you first apply the damage reduction of Heavy Armor Master, which removes 3 from the slashing damage you take, the rest of the total remaining damage is what the creature "damages you with" that you can react to with Parry. Parry has no limitation on the type of damage it can reduce, as long as it comes from a melee attack. If only poison damage remains, it will reduce the poison damage.
If both slashing and poison damage remain for the parry, current consensus is that you as the player decide which to reduce first (but your DM might rule otherwise). You do not have to assign it to the slashing damage first.
The main difficulty here is if Heavy Armor Master damage reduction is applied before the Parry damage reduction or not. I think because it is reducing the damage you take, so you are taking less damage, and Parry happens when you are already being damaged, it makes sense to apply it first.
If that would not be the case, the order in which multiple effects that happen at the same time is resolved by default it is up to the DM. There is an optional rule in Xanathar's Guide to Everything (p. 77), by which it is up to the person at the table whose active turn it is. In this case, when you use your reaction to Parry an attack, this likely also would be the DMs turn (unless it is an opportunity attack).
In this case, it probably would not change the outcome. Let's assume the DM decided that the Parry damage reduction is applied first, using the logic that a parrying an attack happens before the part of the attack you were unable to parry then will hit your armor: you still could choose which damage to reduce, and pick the poison damage first, leaving slashing damage for Heavy Armor Master to take care of.