Not on your own as a default — famotidine (Pepcid) and omeprazole (Prilosec) both lower stomach acid, and the NHS lists famotidine among medicines that "may not mix well" with omeprazole, so combine them only on a doctor's or pharmacist's advice.
They aren't a dangerous chemical clash, but they do the same job by different routes: omeprazole is a proton pump inhibitor (PPI) and famotidine is an H2 blocker, and both work by "decreasing the amount of acid made in the stomach" (MedlinePlus). Because of that overlap, NHS guidance specifically names "other medicines that reduce stomach acid, such as lansoprazole and famotidine" as drugs that may not mix well with omeprazole — this is a therapeutic-duplication caution, not a report of toxic interaction. Doctors do sometimes deliberately pair a daily PPI with an H2 blocker (for example for nighttime acid breakthrough or hard-to-control reflux), but that is a clinical decision, not something to layer on yourself by combining two over-the-counter products.
If you feel you need both, ask a pharmacist or doctor first rather than stacking two OTC acid reducers on your own. Respect each label's limits: nonprescription omeprazole should not be used for more than 14 days or more often than once every 4 months without medical advice, and OTC famotidine should not exceed 2 tablets in 24 hours or be used longer than 2 weeks without a doctor (MedlinePlus). Tell your doctor and pharmacist about every prescription drug, OTC medicine, vitamin, and supplement you take — and separately note that omeprazole itself interacts with some drugs (warfarin, clopidogrel, digoxin, phenytoin, certain HIV medicines, and St John's wort). See a clinician rather than self-treating if heartburn lasts beyond these timeframes, returns quickly, or comes with trouble swallowing, vomiting, black or bloody stools, chest pain, or unexplained weight loss.
This is general reference, not medical advice, and not a guarantee of safety. Interactions depend on your doses, health conditions, and other medicines. Always confirm with your pharmacist or doctor before combining products, and follow the dosing on each label.