Yes you can if they’ve advised rest and work requires you to be on your feet then you can be off sick with a doctors note, if your in U.K. I dunno about other places,you generally have to self certify for a few days first though then get a written sick note

Definitely. He should be willing to write you a note stating that you should stay off of your feet. Provided that you can continue to do your job with a reasonable accommodation from your boss, it should work.

If there's no way you can do your job sitting, and there are no other jobs you are suited for, your boss might be within his rights to discharge you, particularly if this will be an ongoing condition--something you should be aware of.