I know that there are many scam sites in the Internet so I want to use a fake credit card generated by Luhn's algorithm. Is it legal to use it to sing up for an online pay service? I don't want to use real card number.
Yup, it's illegal. You want something, they have something you want. They let you have the thing provided that you do certain things, otherwise they won't give it to you. So providing a credit card is material to the contract. You know that the credit card number is false, you are representing that it is true, the card is a material fact, you intend to get them to allow you in using this false representation, they don't know it is false and they rightfully rely on your truthfulness. They have been harmed by your false representation (maybe: it would cost you a lot in attorney fees to try to challenge on this point). This is fraud.