Lungs are basically a gas exchanger. To breath you need a large surface area (75 m² for a human, according Wikipedia) to exchange this gas, for a human. If you supposed that the greater is the animal is, the more surface he needs, its sails need to be monstrous. Especially an animal the size of a Spinosaurus or Dimetrodon.
The other issue is the movement. An animal with a very large sail couldn't move easily by standard means (I mean legs). It can't be a carnivore because of this, as it couldn't run after a prey.
In this case I see three maybe plausible solution:
a very peaceful and massive grass eater with a giant sail (more or less, like a stegosaurus). It doesn't need to move fast nor think, so it reduces the oxygen consumption
a swordfish like reptile, living in the desert, sailing on the sand with its sail. The wind provides it with speed so that it could hunt. The surface of the sail allows it to capture the dew to drink. As it doesn't move by itself, it doesn't need much oxygen and could even have a really giant sail.
an hippopotamus like animals, living in symbiosis with a single leave fern or tree providing the hippopotamus energy, sun protection and vital gas when the hippo provides mobility and nutriments to the giant sail like leave. In this case the hippo could even sail on a river and even an ocean, navigating like a boat with its leave-sail.
To recap: I think this kind of animal isn't really possible for a known life form on Earth, but with some kind of exotic cases it may be plausible. You could think about moving trees or maybe chlorophyll fed butterflies, too.
Short answer: it's plausible, but you'll want to look into the details of cutaneous respiration. You'll need to address the three constraints of ventilation, diffusion, and convection, as well as finding a way to keep the surface responsible for diffusion moist.
An insect modeled on a Dimetrodon, with the sale covered in structures like very tiny alveoli, seems like your best bet. I think that with some creativity, this could be made believable.
Technically book lungs are external lungs and can be found in numerous existing creatures such as spiders, crabs and other crustaceans.
There is a size-limit in how big a creature could get while possessing book lungs, however.
Pretty vulnerable place to have an organ like that I would think, but possible. Lots of sea worms have exposed gills on their backs yet survive.
It's unlikely to have evolved on earth, because creatures with lungs here usually (always?) have rib cages protecting them. But there is no physical reason I think of that that organ couldn't be anywhere on the body. It's essential to life so I'd expect it to be protected in some way.
The sail could also work a different way instead of lungs. Lungs are not the only gas exchange system that has evolved on earth or even the most common. It could collect oxygen from the air by absorbing it through special pores or something. It would take some fancy physical mechanics to circulate the gases, but it's perfectly doable.