The ideal fingerings to use would normally be:
Hammering on - Use your index finger for the first note that you will play. This leaves the other three fretting fingers available to hammer on to the next note. However, you may find in certain situations that it will be one of the other fingers that plays the initial note, depending on what position you will be moving to for the next note.
Pulling off - Basically, you need to have spare fingers behind the finger that you fret the first note with. This means that you will not use your index finger for the initial note as that would leave you no fingers to pull the next note off onto.