Yes, paystub generators are legal if you use them for legal purposes. Just as in anything, only illegal actions and intent are illegal. Representing your true income on a document is very legal.