Floor plumbing pipe too far away from the wall for vanity
Yes, you can reroute the pipe.  

1) Draw a diagram mapping out how you want the pipe rerouted.  Use 90 degree angles and remember you need to leave room for the trap which in your case will be an "S" trap (so named because it looks like an S that's been rotated 90 degrees.

This looks like inch and a half pipe but you can cut a piece off the top and take it with you to ensure you get the right size.

Get yourself: 


a "stick" of PVC pipe of equal diameter (a stick is a piece of PVC 8' long - although some places sell 2' lengths and you can probably get by with one or two of those)
enough 90 degree connectors for the same diameter
several extra inexpensive connectors - both straight and angled - you'll use them to learn how to glue
either a hacksaw, a PVC pipe cutter
PVC primer (purple) and PVC glue (clear NOT yellow) - if unsure ask at the shop and show them what pipe you're getting
if you need new pieces to make the trap, get those as wel


(be prepared to go back to the hardware store 1 or 2 times - most plumbing jobs for me require 3 trips - 1 to buy the supplies, the 2nd to buy the stuff I forgot the first time, and the 3rd to buy replacements for whatever I broke during the work...)

Before you cut the pipe from the floor, make sure that you do not cut it so low that you won't have room to work.  You'll need a couple inches of exposed pipe to be able to glue the pipe properly and have room to hold it steady while you attach the pieces being glued.

Build your new plumbing pipe construction WITHOUT glue, cutting pipe to fit and putting it in place, making sure your pipes will be the right length and angles to get around the vanity and into position to fit the S trap.  There's really only one rule here - don't run any pipe uphill against the water-flow.  Other than that your pipe can go wherever you need it to.

After you've tested the fit and ensured you can get from floor to trap and trap to sink ok, number the pieces in order to be placed and then set aside.

USING SCRAP PVC PIPE LEFT OVER AND THE EXTRA CONNECTORS - test gluing a few times.  The glue process is as follows:


Apply a very light coat of purple primer to the outside end of the pipe and the inside of the connector.  The coat should cover the entire pipe in a band about 1/2" wide.  
Apply a light coat of glue in the same places - again make sure the coat is complete - don't go too light - excess can be wiped up but shortage can't be fixed.
Insert the pipe into the fitting and apply enough pressure to squeeze the two parts together until snug
Hold for a count of 10 seconds
Release and wipe up excess


Test your new fitting by filling with water and ensuring it doesn't leak.  Do that 2-3 more times and then start gluing the real thing together.

The primer does two things - it cleans the fittings and it also softens the PVC temporarily.  Being softened it allows the PVC to bond very well with the glue.  Once the glue cures, the glued joint will be stronger than the PVC, if bonded properly.  Proper curing takes about 24 hours though you can usually use a drain like yours in about an hour, since there won't be any pressure.

Good luck!