Yes, you can. There is nothing special about the pins an LCD like this uses, it's just simple IO. You can even use the "Analog" pins for digital IO. The only pins to stay away from, which is a good rule in general, are the TX and RX pins (pins 0 and 1 on the UNO) as they are used for communication with the PC through USB. All the other pins are ...
Hello I had the same problem and noticed that if you setup the lcd screen in this order:
LiquidCrystal lcd (d7, d6, d5, d4, , en, rs) ;
you get some weird character showing up...
but if you do this way:
LiquidCrystal lcd (rs, en, d4, d5, d6, d7) ;
you don't get any weird character.