A male and a female dwarf gourami? Yes. Two males? No.
I'd also add that you should avoid buying dwarf gouramis unless you have access to locally bred fish. A recent veterinarian study found 22% of dwarf gouramis from Singapore infected with the Dwarf Gourami Disease virus. Since the virus is extremely contagious, once one fish gets sick, all the other dwarf gouramis in the tank will get infected. To my mind, spending money on commercially bred dwarf gouramis is a complete waste, and worse, it does nothing to get the fish farmers in Asia to change their methods.
Far, far better to go for one of the similar but much more robust species like Colisa labiosus or Colisa fasciata.
Cheers, Neale