It is quite common to use documents you have filed in court as a legal writing sample; however, this must be approached carefully because of confidential information. When doing so, you should always check your local rules to see if there are any specifications regarding this issue.
When using a filed document, local rules and statutes should be your sources on what information is and is not confidential and what needs to be redacted or changed. You can also seek out an ethics advisor in your bar association to consult on what needs to be redacted if you are not sure.