There are a couple of distinct subquestions involved.
First, it is possible for a landlord to charge you without advanced notice or evidence?
The answer to this is that usually the lease will authorize the landlord to do this, either by docking your security deposit or sending you a bill and threatening to evict you if you do not pay it. Either way, to fight the landlord, you will either have to sue the landlord (in the case of the security deposit charge), or defend yourself in court from an eviction case (in the later case).
Second, is it legal for the landlord to charge you if the landlord has no basis for believing that the work needed to be done?
The answer to that is probably not, as the landlord has an obligation to carry out the duties under the lease in good faith. But, the fact that you have an animal on the premises would normally constitute a sufficient basis to insist on a carpet cleaning without any particularized evidence that it was stained. The need for carpet cleaning is a natural and ordinary thing to infer from the presence of an animal on the premises.
Also, if your roommate requested the carpet cleaning, that is normally going to be binding on both of you. You and your roommate are normally jointly and severally responsible for each other's actions under the lease and it doesn't matter if your roommate was truthful to the landlord, or if your landlord accurately stated the reason for the roommate's request. If the roommate requested a cleaning and the landlord complied, both of you are obligate to pay for it. When your roommate has notice or gives permission, generally, so do you in the eyes of the law.