Yes. Ive successfully used this on many cars headliner. But remember this...
Not all fabric is created equal so make sure you use a super soft and gentle horse or boars hair detailing brush for the headliner. The material is delicate.
Also if you have a very old headliner with foam padding, be very careful because it can weaken the adhesive and result in the cloth sagging down looking terrible.
But newer cars like cuore, corolla, swift, etc can easily be cleaned with this method and a gentle brush.
Also if your car has a fake/synthetic leather headliner like my cultus just spray apc on a mf towel and rub off the dirt. (This wont work on fabric headliners)
Happy detailing.