I think that ডেক্সটার may have been "poisoned অথবা drugged" himself and that is why he see's Doakes অথবা it might be just like him seeing Harry. All things considered I think he might be arrested in reality and then comes clean saying that he (Dexter) faked Doakes death and really Doakes was killing for ডেক্সটার thats is why the killing's were still going on. I know it's a ridiculous idea. :-P
Well, he's not going to jail (permanently), that much is certain. There's still another season so that can't happen till the end of the series (though I doubt they will end it this way). He'll get out of this somehow and live to kill another day.