Haki vs.Venom Venom Fruit Knowledge:



Busoushoku Haki:

This Haki can be used as armor against strong attacks or devil powers.


  This type of Haki also has the ability to bypass the powers of a Devil
  Fruit user, touching the "substantial body" beneath whatever
  protection the fruit provides, such as the case of body-altering Devil
  Fruits such as Logia or Paramecia users.






Venom Venom Fruit:


  The Doku Doku no Mi is a Paramecia-type Devil Fruit that grants the
  user the ability to produce and control different types of poison
  [...]
  any person who touches the user will be poisoned.


So everything Magellan touches gets poisoned...





So if Luffy could have used haki, would that have prevent him from getting poisoned?
No, Haki wouldn't help him.  It was established that many prisoners knew how to use Haki and that Magellan was the only one capable of keeping them in line.  Furthermore Blackbeard and his crew are potent haki users, he definitely got his butt handed to him only to be saved with the antidote from Shiryu.  

Its good to note that while haki lets you hit the body of users, it doesn't negate powers like the sea, or yami yami fruit.  While the Haki user can hit Magellan which was never an issue for Luffy, it poisons anyone who has contact with it.  

Similar issues are present with some other paramacia users like Sugar in the Donquixote Pirates where contact with her turns even haki users to toys.