Yes, as long as the compressor is still good. You'll need sil foss, preferably 15 percent silver, but you can get away with five percent-but you can't use the soft stuff that plumbers use.
Can you weld, or braze?
Window units usually don't have refrigerant valves. This is a fine opportunity to install them-and you can either get the self tapping, "self sealing" kind, or you can use the (better if you can weld) stab in kind that require a torch, and some skill.
Again. If you can give me more information about the window unit-I might be a better help. Older window units are typically built better than any of the new ones that I've seen here lately. What's crucial is the question, "is the compressor still good?"
I can help you figure that out if you've got a multi-meter(volts, resistance, amps).