Usually this is possible; sometimes it is not. Unfortunately it depends on a number of unpredictable airline back office systems. It helps if you can do online check in.
For a different airport to print a boarding pass, first they have to check you in remotely. This is a different process from online check in, so even if online check in fails this can still work. For this to happen the flight must be unlocked (sometimes the flight is locked for editing by headquarters particularly if you are trying to check in many hours in advance), and the departure airport must allow remote check in. The departure airport can turn this off for many reasons, most of them technical reasons.
There are at least two different ways to do a remote check in; there is an "easy" way that most of the newer check in agents will know, and there is a way that only the older agents seem to know. So if your first try is unsuccessful, it can be worth asking again.
[Finally, there are cases where the first airport has telephoned the departure airport and got them to do the check in over the phone so that the boarding pass can be printed; and I even know of a few situations where the pilot has radioed ahead to ask for the check in to be done and the boarding passes were waiting at the gate(!). However neither of these options are going to happen for you with Qatar Airways.]
Once you are checked in, it is not difficult to print a boarding pass; this is just a piece of paper.
If you are unsuccessful in obtaining your boarding pass at your first airport, most international airports outside the US facilitate international-to-international connections without needing to pass through immigration. They have a means for travellers to obtain their onward boarding passes in the connections area, usually by providing staffed airline counters before security. At worse this may mean waiting for some time while a member of staff goes away to get your boarding pass for you. However, I cannot speak for COK airport specifically.