I'm not aware of any laws that would prohibit this. The real question is who assumes the liability? If you are at your University hospital or an affiliated one and this is part of your education, the school covers you with their malpractice insurance. If you aren't, then the hospital and/or the surgeon involved could be liable for you if you do something that causes a problem (or I guess you could be as well, but you're not exactly a deep pocket and could reasonably be termed to be an "agent" of the attending surgeon who can only be asked to perform to the level of your training, which is nil)
Bottom line: it's legal in virtually any context. If this is at your school's affiliated hospitals it is probably no problem. If it isn't a teaching hospital or the surgeon doesn't regularly participate in teaching, it may be against hospital rules or the surgeon's malpractice carriers rules to use an unlicensed assistant but that is their call. It is unlikely but possible that you could get in trouble for it personally.
Disclaimer: Not a lawyer, don't even play one on TV. Just rambling based on what I think sounds right.