To summarize and add something, though small rifle and pistol primers are the same height, large rifle primers are 0.010" taller than large pistol primers, so they tend to stand proud when seated in a large pistol primer pocket. The rifle primers are also usually harder to ignite, and so are less reliable with a firing mechanism not designed for them. Some revolver cartridges (e.g., 460 S&W) are designed for large rifle primers and the guns made for them are specified to fire same. Finally, rifle primers (large or small) make a larger volume of gas than their pistol counterparts do, in order to pressurize the larger rifle cases to start their generally slower powders burning well. In a small handgun cartridge case's powder volume, that extra gas can unseat the bullet before the powder starts burning well, and thereby make the ignition erratic despite the extra gas. Conversely, when the bullet stays put, they can cause the pistol powder to start burning faster than usual, raising the peak pressure and necessitating reducing the load.
So, broadly speaking, accept no substitutes.