The diopter would make you THINK everything is out of focus, but as long as you are using auto-focus, the camera would take a clear photo. The diopter would only affect the photo if you are using manual focusing - because you're telling the camera what to use for settings based on the blurry image you're seeing due to the diopter.
If the lens is dirty enough to affect the photo to that extent, then the camera would have a difficult time locking focus to take the photo in the first place.
As others suggested - try different lenses on the camera to see if the problem repeats. If it only does it with the one lens, then that lens is the problem. If it does the same with them all, then the camera is the problem.
It could be something got jarred inside and is out of position.