I don't know about NATO, but any country contributing troops to the UN gets paid for it. Some pass this on to the troops, some keep it for their treasury (e.g the UK).
This UN funding for troops is a major source of income for some African/Asian governments - which is why you often find UN troops coming from these countries!