There are differences in the cable and port alike; the connectors are different.
And there's no "plain" DVI connector, it's either DVI-D, DVI-A, or DVI-I (and also either single-link or dual-link).
But nowadays most things are dual-link DVI-D or DVI-I, the other types are rare/obsolete.
A cable with a DVI-D connector can plug into a DVI-I port, but in principle not the other way around. DVI-D ports may, however, still have the holes to allow a DVI-I connector to be inserted - the extra holes just aren't electrically connected. Then it works like a DVI-D connection.