Can I use someone as a reference if I worked under the table?

My last job was under the table and I wanted to use my old boss as a reference because I know she’ll have good things to say about me, and that’s the only job I’ve ever had but is that even allowed? And would that get her in trouble?