Is it ok to place a window AC unit in front of the window instead of hanging outside?
This should work, except there are some potential problems:


Usually a window A/C gets rid of the indoor heat by taking outside air and heating it, discharging it outside. Here, you're taking inside air and heating it (still discharging it outside). This will work, and it's exactly how single-hose indoor air conditioners work. However, it's less efficient (perhaps a lot less efficient).
The evaporator coil (that cools the indoor air) also condenses water, which has to be disposed of outside through a drain. It's quite possible that the normally-outside drain is now inside, and you're going to find an increasingly large puddle on your floor.
Your A/C will likely be noisier than it usually is (at least indoors, but that's where it counts).


So, it'll work, but there may be issues (the water one being the most immediately concerning).