The on beat hammer-on requires picking a bass note by itself and then picking the first note of the hammer-on immediately after on the following off beat. The hammered note is then played on the next on beat. This type of hammer-on is a little more difficult because it is necessary to hammer the string at exactly the same time as the next bass note is played. Study the following example. In the first bar an alternating thumb style pattern is played over a D chord. The second bar is very similar except a hammer-on is played. At the beginning of this bar left the second finger of the fretting hand off the first string. Play the first bass note of the second bar then play the open first string, remembering that this is the string that is normally played in this pattern. The second finger of the left hand then hammers back onto the first string at exactly the same time the right hand thumb plays the bass note on the second beat of the bar.
The next chord progression utilizes both the off beat and on beat hammer-ons. Practice the progression first using a basic alternating thumb style pattern. Once you are comfortable with the progression try adding the hammer-ons as notated.