The simple answer is yes they can still prosecute you after you are discharged. This can happen a few ways. First, at any time, the personnel system could place you on an administrative hold. This is similar to a stop loss, but it is triggered by coding your personnel status as "under criminal investigation." I have had clients go as many as 12 months past their ETS just so they could be court-martialed!
Another this which is possible is to discharge you and then recall you to active duty for prosecution. In reality, although this is legally possible, it happens very rarely. There are many loopholes to jump through and the process requires high level approval, all the way up to SECNAV's level.
The final way that something could happen is to have the case referred to civilian (Federal) authorities outside of the Navy for prosecution. Here again, this is rather unlikely to occur, but in once case I handled, it happened because the personnel system never stuck my client on admin hold and he did, just as you are suggesting, flea out of the back door when no one caught it. He had his Honorable discharge and eventually the US Attorney into whose lap that case fell, dropped the case.
I suspect that you will be extended involuntarily until the NCIS figures out what they want to do with you.