It is illegal if the reference will be in any way false--for example, it will create a reference in the name of a person or business for whom the employee did not work, or will state anything about the employee which is untrue or which is attributed to someone who did not say it, etc. False references to help someone get a job--i.e. to help someone get money from any employer based on false representations--are fraud, and could potentially result in criminal charges and/or being sued. If everything is 100% truthful, it would be legal, but it's difficult to see how you could generate a useful truthful reference for someone show did not work for you. (And if they did "work" for your business, your reference has to be truthful and accurate to their title, what they did, their tenure, their responsibilities, their pay, etc.)