Yes, you can attach a keyboard to an iPad. It's not the easiest thing in the world, though:
1. Hardly any keyboards use the dock connector/lightning port. Pairing bluetooth keyboards is a lot of effort for what it is.
2. Even if you do, it's not attached to the device. You'd need to sit down somewhere or have somewhere close by to prop the iPad up against while the keyboard rests on your lap. It's rather uncomfortable.
The Surface did well here by making the keyboard physically attached to the device, so you could use it in laptop-formation. Again, tablets being smaller than laptops makes it even harder to use than a laptop in this mode.
Basically - if you were writing a report, you wouldn't use a tablet ( any tablet ). The best tablet for writing like that basically just tries to be a laptop, but it's much more awkward to use than a real laptop.
But the problem is the hardware/form factor, not the OS. iOS is capable of pretty much anything you could do on a Mac.