Yes, you certainly could ...
A minor and a major problem. The minor problem is that you have depicted a switch to 5V, which is bad practice; you should have the switch to ground, use the INPUT_PULLUP function instead of the 10k resistor and of course, the LED to 5V with its 220 ohm resistor.
The more major concern is that you should have the switch via a 330 ohm resistor to the Arduino pin, just in case you were to get the code wrong and set the output HIGH while the switch is pressed. This is somewhat more likely since you do in fact write the output HIGH to enable the INPUT_PULLUP.
Needless to say, this works by setting the pin to output and writing it HIGH (and in that exact order) to read the pushbutton. So long as the LED is to be not lit, you can leave it that way. If you want to light the LED, you write the pin LOW and then set it as an output (in that exact order) and leave it that way until you need to read the button next in which case you briefly perform the button read sequence and immediately re-enable the LED.