This is not trivial, but is routinely done in laboratories and commercial products (like surround stereo systems). If we consider the strictly physical aspects of sound localization in humans (and probably many other living beings who cannot conscientiously orientate their ears), there are two main phenomena to take into account:
1. Interaural time difference (ITD), a slight delay between both ears due to one ear being further away form the source than the other and thus sound has to travel slightly longer to reach it.
This little drawing helps understanding what I mean (source):
So in order to simulate sound coming from one side or the other without moving the speakers, you will need to alter the signal from one or both speakers to try to reproduce this effect. Note that even if you were able to reproduce it correctly, there are many more psychophysics aspects that will get in the way. But as a rough start you could try these equations (c is the speed of sound in air):
$$τ= (a/c)2 sinθ$$
for frequencies below approximately 500 Hz, and
$$τ= (a/c)(θ+ sinθ)$$
That is assuming, among many other things, that people have spherical heads, which is a rather rough estimation.
2. Inter-aural intensity difference (IID), a frequency-specific difference in sound intensity due to the head "shadow" effect, where some frequencies are partially blocked by the head on the path to the ear that is not facing the source.
There is, to date, no analytical way to simulate this effect, you will have to rely on empirically measured transfer functions, such as the Head-Related Transfer Function (HRTF) in the horizontal plane, where the relationship between the angle theta and the frequency response looks like this (source of the picture):
Now you can see that the position of the speakers themselves is not directly linked to the simulation of these effects and it's probably possible to simulate a sound source that appears to be at the left side of the left loudspeaker, that is outside the physical location of the speaker array.