Having an STD doesn't mean that you can't have sex (Unless of course you have one that rots your bits off). It just means that you shouldn't.
Two people with different STDs can have sex with each other, but they risk rending up with two STDs instead of one.
Two people with the same STD can have sex with each other, but if they have different strains of the same STD then they can make things worse.
Two people with STDs can have sex with random people that hey meet in night clubs, but they can be charged with criminal assault if they knowingly pass on their STD.