Yes. Not doing your homework is a breach of trust between you and your teacher and a direct dismissal of their instructions. An apology letter can help make things right and get you more time to complete the work.