Yes, it's fine to take Phenergan with painkillers which are available over the counter such as paracetamol, aspirin and Ibuprofen.
Some pharmacy only medicines however may also contain codeine or dihydrocodeine. These painkillers can cause drowsiness, and if taken with Phenergan can increase effects of drowsiness experienced.  Avoid driving or operating machinery