Hi
Yes you can do this as long as the interface is fastethernet or gigabitethernet.
You need to create subinterfaces on the ethernet port eg:
interface fa0/0.10
encapsulation dot1q 10
ip adddress "ip" "subnet mask"
interface fa0/0.20
encapsulation dot1q 20
ip address "ip" "subnet mask"
You will need to make the connection from the ethernet interface to the switch a trunk link on the switch.
You will need IP PLUS feature set minimum to do the encapsulation.
HTH