The quick answer is that you can’t. Not with simply applying the dashed line to a stroke. Illustrator doesn’t align dashes based on the document grid, it’s based on the line and nodes.
If you want them to line up, you will have to manually separate either the outside or the inside line to shift the start point for the dashes.
Billy Kerr’s answer below is MUCH better!