The answer is no it is not illegal for a company to decline paying either vacation or sick time after you resign. In large well established companies the employee policy guidelines will state the company's policy on pay out of vacation or sick time, with a two (2) week notice. That is the reason most experienced employees use all vacation and sick time prior to handing in their resignation.
As a Vice President for 20 years at a major bank on Wall Street the hand written policy was clear that you received in your paycheck payment for unused vacation days based upon the time of year you resigned.
Example: If you were due 3 weeks vacation and resigned prior to March 31 you were not paid for any unused vacation time. In the event you resigned June 31 you received two weeks vacation. If you resigned in October you would receive payment for all unused vacation time.
Under no circumstances were you paid for unused sick time.