Not a good idea. There is a very good reason why companies make rifle and pistol primers. Rifle primers have a much stronger cup and can take the higher pressures generated in a rifle. Pistol primers have a softer cup. This helps detonation with a weaker hammer blow.
In other words, a pistol primer might blow out when used in a rifle. By the way, pistol and rifle primers are the same diameter but rifle primers are a few thousandths longer. Also, there is more mix in a rifle primer so it will create more pressure and hotter ignition. A pistol primer may not provide enough ignition to properly light up slow burning rifle powder.