Is playing stronger oppenents useful as a beginner? I have signed up to a chess websites and there are very few people who are as bad as I am (rating around 800), so I have to resort to playing against people who are much better (1200+) and end up beating me very quickly.

I do analyze the games to see what went wrong but I am wondering if it's even worth going up against players much better than me, since I don't get to even the end game stage.
As long as you're also playing players of your rating (and lower) along with the higher rated players it's okay. You don't want to be discouraged by losing every single game you play. Ideally you want to play people higher rated than you more than lower rated because it's like getting a free lesson - a higher rated player will be able to take advantage of your mistakes more than a lower rated player. 

At a 800 rating, you'll want to focus on basics (basic opening principles, tactics, safety, thinking processes etc.) and review your games for common mistakes to pinpoint weaknesses and then eradicating them. 

Of course, you'll also want to play slow time controls more than fast time controls as you want to be able to think about your moves and then be able to go back and correct your thinking. Faster games involve a lot of intuition and at your rating you won't really have a lot of it. So you'll want to develop that by playing slow time controls. Besides, you don't want to mess up games and then excuse yourself by saying that you didn't have enough time on your clock. 

Also, you should begin reviewing some (master) chess games. A decent beginners book is Logical Chess by Irving Chernev. Don't review modern GM games yet as those are generally a lot more difficult to understand.