Always rinse well before recycling. If it is not possible to rinse out, throw in the trash. Do not put a dirty carton into the recycling bin.
Liquid packaging cartons are made of paperboard coated by polyethylene (a type of plastic) and sometimes lined with foil. Sometimes they have a"gable top" (the triangle top like on many milk cartons which can be pushed apart to form a pouring spout) and/or a plastic cap (HDPE).
There is a facility in Malaysia (read about them: KPT Recycle Sdn Bhd ) that can fully recycle such cartons. However not all the public waste collectors sell to them.
Cartons sent to this facility get recycled into paper and a material called "polyal" - a mixture of plastic and aluminum that can be used in construction.
Cartons sent to non-specialised facilities just recycle the paper component of the cartons and discard the plastic & foil part.