Al Jazeera's Kamal Hyder, reporting from Islamabad, said Gates's suggestion would anger most Pakistanis.
He said: "The Pakistani people believe that it is only their armed forces that are able to handle the continued violence in the tribal region."
"Musharraf himself said that if foreign intervention is applied, it would be construed as an act of war.
"But ultimately, the government believes that an end to the conflict is via a political solution - not a military one - and it should not be dictated from overseas."
The US military is under strain from fighting the wars in Iraq and Afghanistan, but the Bush administration says it is concerned about the ongoing clashes in Pakistan's tribal areas.
US officials have alleged strongholds bordering Afghanistan have become safe havens for Taliban and al-Qaeda fighters.
The United States already helps train Pakistani forces. Its efforts include a programme to coach and equip the Frontier Corps, a paramilitary force recruited from tribal areas.
Washington has given nuclear-armed Pakistan around $10 billion in aid since 2001 when Islamabad dropped support for the Taliban movement in Afghanistan and joined the US' so-called "war on terror".
US operations in Pakistan would be highly sensitive politically for the government of Pervez Musharraf, the president, and Gates said it would be up to Pakistani leaders to take public opinion into account when considering any US assistance.
Gates said only a small number of US troops would be involved in any joint operations with Pakistani forces to target al Qaeda, but he did not give a figure.
Pakistani forces have clashed over the past week with militants in the South Waziristan region on the Afghan border.
Nearly 150 fighters and more than 20 soldiers have been killed in the fighting.
Meanwhile, the Pakistani military said on Friday it had successfully test-fired a nuclear-capable ballistic missile.
The Shaheen-1 missile with a range of 700km was launched from an undisclosed location, at the conclusion of the army's annual field training exercises.
Pakistan has routinely tested missiles designed to match those of India, its neighbour and nuclear rival India.