Yes - you may get married,
however - you will not claim your spouse as a dependent of your US tax return.
Instead - you will file joint tax return with your spouse - regardless if your spouse lives in the US or abroad.
You would need to apply for tax ID for your spouse.
If you are married on the last day of the year - for tax purposes - you are considered as married the whole year.
If you are an US resident for tax purposes - you may choose to treat your spouse as an US resident - and claim all income worldwide on your tax return.
Let me know if you need any help.